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 codeDescription
S_OK

The hook processed the execution. ShellExecute or ShellExecuteEx should not perform any other processing.

S_FALSE

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

Shlobj.h

DLL

Shell32.dll (version 4.0 or later)

See also

IShellExecuteHook

 

 

Community Additions

ADD
Show:
© 2014 Microsoft