Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Explorer Customize Posted by mhulla on 13 Apr 2003 at 7:13 AM
Hi Everyone

Ive written a little tool which calculates a CRC32 of a file and now i want to add an entry to the contextmenu which appears, if you right-click an icon in the explorer. Ive already checked out the registry for other programms which use this ability and it seems to work with DLLs. Can anybody give me a clue how to do this ?

Im using WinXP and Visual C++ 5.0.

Thanx,
Mhulla.
Report
Re: Explorer Customize Posted by adrianxw on 13 Apr 2003 at 7:52 AM
: Hi Everyone
:
: Ive written a little tool which calculates a CRC32 of a file and now i want to add an entry to the contextmenu which appears, if you right-click an icon in the explorer. Ive already checked out the registry for other programms which use this ability and it seems to work with DLLs. Can anybody give me a clue how to do this ?
:
: Im using WinXP and Visual C++ 5.0.
:
: Thanx,
: Mhulla.
:

Try this. Open explorer, then Tools->Folder Options, then select the File Types tab. That gives you a list of the "known" filetypes. Scroll down to the type you want to act on, (for example, .txt), then click "Advanced". Here you can see the options already there, and you can add additional ones by clicking "New" and filling in the name of the action and the path to the program that does it.

Med venlig hilsen,

Adrian...

Report
Re: Explorer Customize Posted by mhulla on 13 Apr 2003 at 9:18 AM
: Try this. Open explorer, then Tools->Folder Options, then select the File Types tab. That gives you a list of the "known" filetypes. Scroll down to the type you want to act on, (for example, .txt), then click "Advanced". Here you can see the options already there, and you can add additional ones by clicking "New" and filling in the name of the action and the path to the program that does it.

Thank you, but that is not exactly what i want. First there is no option to add my little tool to every known filetype and second i also want to code an installer which does this automaticaly. I really believe i have to do this in the registry. What i already know is, that there is a key named "HKEY_CLASSES_ROOT/*". There are a few programms, like WinRar which use this key. But they all use DLLs.

Mhulla.
Report
Re: Explorer Customize Posted by chick80 on 14 Apr 2003 at 11:51 AM
I'm not really sure this is the best way, to do it, but you can do a system-wide hook (so you'll need a DLL or you can't access other processes memory) and subclass Explorer processing the WM_RBUTTONUP messages.
Pheraphs it's not so simple, but it should work.

See this for some info about hooks:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_subclas3.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Hooks/AboutHooks.asp




How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.
JOHN KEATS


Report
Re: Explorer Customize Posted by pingpong on 14 Apr 2003 at 2:20 PM
: Hi Everyone
:
: Ive written a little tool which calculates a CRC32 of a file and now i want to add an entry to the contextmenu which appears, if you right-click an icon in the explorer. Ive already checked out the registry for other programms which use this ability and it seems to work with DLLs. Can anybody give me a clue how to do this ?
:
: Im using WinXP and Visual C++ 5.0.
:
: Thanx,
: Mhulla.
:

What you are looking for is called a "Shell Extension". Windows has a set of COM objects to let your hook into the windows explorer. Adding a new item to the file properties menu in explorer happens to be one of them.

Start from here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_extending/extensionhandlers/shell_ext.asp
for the different types of extensions you can add, the one you are probably looking for is "Shortcut menu handler".




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.