A friend of mine was asking how he could use his own options in a right-click menu of folder objects.
I know its to do with IContextMenu interface, COM related.
Has anyone written one in assembly, or know of any source already out there?
thanks
What do you mean by 'options'
P
He means adding context menu items - right-click on a file of a particular type gives you the usual menu plus your own (program) associated menu items.
You 'can' do it by adding registry entries into the appropriate file type under HKEY_CLASSES_ROOT
But I assume there will be an API way to do it too - of course I'm not being much help because I don't know what that is ::)
Another way would be to write a registry command file (eg. Dip.reg) and execute it. To add the program E:\Program Files\Dip.exe to the folder context menu, I use a file with this contents:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Dip]
[HKEY_CLASSES_ROOT\Directory\shell\Dip\command]
@="\"E:\\Program Files\\Dip\\Dip.exe\""
[HKEY_CLASSES_ROOT\Drive\shell\Dip]
[HKEY_CLASSES_ROOT\Drive\shell\Dip\command]
@="\"E:\\Program Files\\Dip\\Dip.exe\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Dip]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Dip\command]
@="\"E:\\Program Files\\Dip\\Dip.exe\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\Dip]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\Dip\command]
@="\"E:\\Program Files\\Dip\\Dip.exe\""
Also, if anyone knows how to add to the context menu you get when you right click on the desktop, I would like to know it please.
well, this guy wanted to add menu item for java compiler whenever he right clicked on a java source code file.
apparently you write a handler in a DLL file, and register it with regsvr32.exe.
i found some source in c since, but no asm.
The java compiler is a command line tool. ?????
P
javac.exe - console based java compiler.
Why not just do it through mycomputer->tools->folderoptions->filetypes ??
the full command he wanted was "cmd.exe /c "C:\j2sdk1.4.2_03\bin\javac.exe %1 | more && pause"
the problem with this, was %1 expanded to 8.3 format..and javac.exe is strict
about name of source file, must be File.java if that is name of class, else it complains.
%1 would have something like:d:\DOCUME~1\user\MYDOCU~1\java\MYSECO~1.JAV
which is no good.
Try enclosing %1 in double quotes.
cmd.exe /c "C:\j2sdk1.4.2_03\bin\javac.exe" "%1" | more && pause
i will tell him to try this,thanks again Greg :)