UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:shobjidl.IHWEventHandler2.HandleEventWithHWND |
IHWEventHandler2::HandleEventWithHWND (shobjidl.h) |
Handles AutoPlay device events that contain content types that the application is not registered to handle. This method provides a handle to the owner window so that UI can be displayed if the process requires elevated privileges. |
|
shell\IHWEventHandler2_HandleEventWithHWND.htm |
shell |
65720250-ace5-488d-9be7-33b07d7cc667 |
12/05/2018 |
HandleEventWithHWND, HandleEventWithHWND method [Windows Shell], HandleEventWithHWND method [Windows Shell],IHWEventHandler2 interface, IHWEventHandler2 interface [Windows Shell],HandleEventWithHWND method, IHWEventHandler2.HandleEventWithHWND, IHWEventHandler2::HandleEventWithHWND, _shell_IHWEventHandler2_HandleEventWithHWND, shell.IHWEventHandler2_HandleEventWithHWND, shobjidl/IHWEventHandler2::HandleEventWithHWND |
shobjidl.h |
Windows |
Windows Vista [desktop apps only] |
Windows Server 2008 [desktop apps only] |
Shobjidl.idl |
Windows |
19H1 |
|
|
|
|
|
|
Handles AutoPlay device events that contain content types that the application is not registered to handle. This method provides a handle to the owner window so that UI can be displayed if the process requires elevated privileges.
Type: LPCWSTR
A pointer to a string buffer that contains the device ID.
Type: LPCWSTR
A pointer to a string buffer that contains the alternate device ID. The alternate device ID is more human-readable than the primary device ID.
Type: LPCWSTR
A pointer to a string buffer that contains the event type. The event types include DeviceArrival, DeviceRemoval, MediaArrival, and MediaRemoval.
Type: HWND
A handle to the AutoPlay dialog that was displayed.
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
When a handler is invoked and requires immediate privilege elevation in a new process, it requires an active parent window handle to display its consent UI. IHWEventHandler::HandleEvent cannot give a handle, so only a blinking taskbar appears. IHWEventHandler2::HandleEventWithHWND provides the HWND and enables the UI to be displayed.
Note that if the handler was launched by default instead of by direct user action, the HWND is not active and the dialog is not shown in the foreground.
The event types are not C/C++ language constants; they are literal text strings.