News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Menu Context Handler

Started by bozo, October 01, 2005, 10:37:24 PM

Previous topic - Next topic

bozo

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

PBrennick

What do you mean by 'options'

P
The GeneSys Project is available from:
The Repository or My crappy website

Tedd

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 ::)
No snowflake in an avalanche feels responsible.

Jimg

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.

bozo

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.

PBrennick

The java compiler is a command line tool.  ?????

P
The GeneSys Project is available from:
The Repository or My crappy website

bozo

javac.exe - console based java compiler.

Tedd

Why not just do it through mycomputer->tools->folderoptions->filetypes ??
No snowflake in an avalanche feels responsible.

bozo

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.

GregL

Try enclosing %1 in double quotes.

cmd.exe /c "C:\j2sdk1.4.2_03\bin\javac.exe" "%1" | more && pause


bozo

i will tell him to try this,thanks again Greg :)