IShellExecuteHook.Execute - Programmers Heaven

Howdy, Stranger!

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




Can someone show me how to use "[link=]IShellExecuteHook.Execute[/link]" in Delphi please?

This method is called any time the ShellExecute or ShellExecuteEx functions are
called. This happens when a file is double-clicked in Explorer or when the Run dialog
box is used.



  • zorfoxzorfox Posts: 5Member
    What are you trying to do?

    I am not that familiar with it. However, I can paste a few things from an ebook I have. Sorry about the code formatting. I didn't feel like formatting all of it :)...

    Shell execute hook extensions are used when the ShellExecute or ShellExecuteEx API functions are called. This occurs every time a file is double-clicked in Explorer or when the Run dialog box is used. The shell execute hook extension can completely process the request (preventing the call to ShellExecute or ShellExecuteEx), or it can perform any desired processing and allow ShellExecute or ShellExecuteEx to continue processing the request. When ShellExecute or ShellExecuteEx is called, Explorer begins loading registered shell execute hook extensions. It sends the request to each one, allowing the extension to perform its processing. This continues until all extensions have processed the request and allowed it to pass on to ShellExecute or ShellExecuteEx, or one of the extensions processes the request completely.

    COM objects must implement the IShellExecuteHook interface to become a shell execute hook extension. This interface has one method, Execute, that is called every time ShellExecute or ShellExecuteEx is called. This method is called first, allowing it to suppress the final call to ShellExecute or ShellExecuteEx if necessary. This method receives a pointer to a TShellExecuteInfo structure containing information about the file being opened or executable being launched. If the extension handles the request and launches the requested application, the hInstApp member of this structure should be set to the instance handle of the application. If the extension did not launch the requested application but wants to suppress the call to ShellExecute or ShellExecuteEx, the hInstApp member should be set to a value greater than 32 to prevent the shell from displaying an error message.

    Shell execute hook extensions must be registered under the HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionExplorerShellExecuteHooks key. Simply write the class identifier of the COM object as the value name, with no associated value. Additionally, Windows NT/2000 requires an entry for the COM object
  • zorfoxzorfox Posts: 5Member
    This post has been deleted.
Sign In or Register to comment.