Advertisement

Right click execution

Started by March 23, 2000 08:51 AM
1 comment, last by xstreme2000 24 years, 9 months ago
I''ve got two questions about right clicking programs First how do you add item to the right click menu... secondly how do you make an extra item come onto the right click menu only for one particula program??? //--- Created by Tom Oram --- // tom.oram@vodafone.net
This is something I've wondered for ages.

If I remember rightly, you can specify a right-click handler .DLL for this, but I don't know how you go about it.

If someone knows (VC++ source code would be nice ) please help out...

George.

"Who says computer games affect kids, imagine if PacMan affected us as kids, we'd all sit around in a darkened room munching pills and listening to repetitive music....uh oh!"


Edited by - GEo on 3/23/00 9:34:16 AM
George. F"Who says computer games affect kids, imagine if PacMan affected us as kids, we'd all sit around in a darkened room munching pills and listening to repetitive music....uh oh!"
Advertisement
Here''s the basics:
In order to change the right-click behaviour of an file type in explorer, you need to register shell extensions called a context-menu handler. To modify the behaviour for a specific file type you need to modify the registry.

A registry entry looks like (from the MSDN library CD, platfrom SDK):
HKEY_CLASSES_ROOT     = <"description">       shell           = <"menu-item text">             command = <"command string">  


An example:
HKEY_CLASSES_ROOT    wrifile = Write Document       shell          open             command = C:\Progra~1\Access~1\WORDPAD.EXE %1          print             command = C:\Progra~1\Access~1\WORDPAD.EXE /p "%1"          printto             command = C:\Progra~1\Access~1\WORDPAD.EXE /pt "%1" "%2" "%3" "%4"  

%1 refers to file name, %2 refers to printer name.
I still don''t know what %3 and %4 refer to.

This method will create a new menu entry for all files of that type.

For a context menu handler that applies to all file types, you''ll just have to look at the platform SDK.

This topic is closed to new replies.

Advertisement