IHandlerActivationHost::BeforeCreateProcess method (shobjidl_core.h)

Notifies a client of ShellExecuteEx that a process is about to created, giving that client the opportunity to display UI confirming that or reject it by returning a specific error code.


HRESULT BeforeCreateProcess(
  [in] LPCWSTR      applicationPath,
  [in] LPCWSTR      commandLine,
  [in] IHandlerInfo *handlerInfo


[in] applicationPath

The fully qualified path to the process executable, or in some cases a DLL path.

[in] commandLine

The full command line that will be passed to CreateProcess including the arguments that the handler requested via its registration.

[in] handlerInfo

Provides access to information about the handler that will be invoked. This object also supports IHandlerInfo2 on versions of windows that support that interface. This object also implements IObjectWithSelection. This can be used to get the Shell item, or items in some cases, that are being launched.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code, HRESULT_FROM_WIN32(ERROR_CANCELLED) indicates that the ShellExecute call should be canceled.


Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See also