IShellExecuteHook::Execute method
Called when ShellExecute or ShellExecuteEx is called for an object that is registered.
Syntax
HRESULT Execute( LPSHELLEXECUTEINFO pei );
Parameters
- pei
-
Type: LPSHELLEXECUTEINFO
The address of a SHELLEXECUTEINFO structure that contains information about the object being executed. On successful completion of the hook, the hInstApp member will be filled in by the hook.
Return value
Type: HRESULT
Returns one of the following values or a COM-defined error value.
| Return code | Description |
|---|---|
|
The hook processed the execution. ShellExecute or ShellExecuteEx should not perform any other processing. |
|
The hook is installed but did not process the execution. ShellExecute or ShellExecuteEx should perform the default processing. |
Remarks
This method provides an opportunity for the application to hook the execution of an object and change the default execution or perform some other action before the object is executed.
If the item should not be executed, Execute can simply return S_OK. To prevent the Shell from generating an error message box, set the hInstApp member of SHELLEXECUTEINFO to 32 or greater.
Requirements
|
Minimum supported client | Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Header |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 11/28/2012