Explorer Customize - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Explorer Customize

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.

Comments

  • adrianxwadrianxw Posts: 127Member
    : 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...

  • mhullamhulla Posts: 4Member
    : 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.
  • chick80chick80 Posts: 349Member
    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


    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS


  • pingpongpingpong Posts: 937Member
    : 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".

Sign In or Register to comment.