Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 25, 2013, 07:42:25 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Context Menus on Drives  (Read 2060 times)
cg
JkDefrag Hero
*****
Posts: 101


View Profile
« on: August 24, 2009, 11:41:42 pm »

While I love the scripting capability of MyDefrag, one thing that does irritate me is when I simply want to defrag a specific drive.  To do that now, I have to either manually edit a script or do a command line run.  I can do that, but why not add a context menu to the right-click event on a system drive?  That way you combine the power of scripts with the ease of defragging a single drive.

You can do it fairly easily in C++ - I did it for a work app 3 years ago and there is now better examples out there than there were then.

If you don't want to do it yourself, why not package Fast Explorer with the MyDefrag installation?  Fast Explorer is a context menu dll that allows you to create a context menu for any application or applications.  Its completely freeware - you just distribute a dll with the application and generate an INI file containing all of the menu items you want.  The INI sits in the same folder as the DLL and you simply register the DLL and voila you have Context Menu in explorer for MyDefrag.  Now when I right click on the drive, it sends the script I chose along with the selected drive so that I'm only running MyDefrag against the drive of my choice.

Take a look at the screenshot below (on my machine running Windows 7 64-Bit).

For those interested, I included an example for 32 bit and 64 bit Operating Systems.  To make it work, you'd have to put the two files from the appropriate OS zip in the same location (maybe the MyDefrag folder).  Open the INI file, do a find and replace and change the paths to point to the folder where YOUR MyDefrag exe is installed (because right now its using my path).   Then do a simple...
 
   regsvr32 "C:\Program Files\MyDefrag\FEShlExt.dll"

...command (again make sure the path points to where you have the DLL and INI file).... If you don't like it you can uninstall the dll just as easy:

   regsvr32 -u "C:\Program Files\MyDefrag\FEShlExt.dll"

BTW this is 100% Freeware both for personal and commercial use:
http://thesoftpro.tripod.com/downloads/fe/kb.htm#portable2

More info on the INI file here:
http://thesoftpro.tripod.com/downloads/fe/kb.htm#installation4

The only downside with the approach the developer took with Fast Explorer is that it requires admin rights, so you could detect if they don't have admin rights - don't even offer the option.  Or warn if they click that as an install feature that it won't work without Admin rights.



* Drive_RightClick.jpg (41.42 KB, 537x259 - viewed 549 times.)
* FastExplorer_MyDefragExample_32-BitOS.zip (133.28 KB - downloaded 226 times.)
* FastExplorer_MyDefragExample_64-BitOS.zip (337.22 KB - downloaded 205 times.)
« Last Edit: August 24, 2009, 11:46:22 pm by cg » Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #1 on: August 24, 2009, 11:50:37 pm »

Thanks for sharing your idea, I appreciate it. I like it and have put it on the wishlist. I don't want to use a third-party tool though, so I will be looking at how to create such a menu in the registry by the MyDefrag installer.
Logged
cg
JkDefrag Hero
*****
Posts: 101


View Profile
« Reply #2 on: August 25, 2009, 12:26:26 am »

You can definitely do it in the registry directly if you don't have a submenu..  Its the submenu that is tricky Smiley  Originally before using this Fast Explorer dll, I did 2 registry items for Fast and Slow Optimize (the only two scripts I really use). 

That's very easy - but if you want to show 5-7 different scripts, you really need a sub-menu because you'd be taking up a lot of real estate on the right click menu.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!