DBT_USERDEFINED event

The DBT_USERDEFINED device event identifies a user-defined event.

To broadcast this device event, call the BroadcastSystemMessage function with the WM_DEVICECHANGE message. Set wParam to DBT_USERDEFINED and set lParam as described following.

LRESULT CALLBACK WindowProc( HWND   hwnd,     // handle to window
                             UINT   uMsg,     // WM_DEVICECHANGE
                             WPARAM wParam,   // DBT_USERDEFINED
                             LPARAM lParam ); // event-specific data

Parameters

hwnd

A handle to a window.

uMsg

The WM_DEVICECHANGE message identifier.

wParam

Set to DBT_USERDEFINED.

lParam

A pointer to a _DEV_BROADCAST_USERDEFINED structure which describes the user-defined broadcast in progress. The dbud_szName member contains the name of the user-defined message, followed by any user-defined data.

Return value

Return TRUE.

Requirements

Requirement Value
Minimum supported client
Windows XP
Minimum supported server
Windows Server 2003
Header
Dbt.h

See also

Device Events

Device Management Events

_DEV_BROADCAST_USERDEFINED

WM_DEVICECHANGE

BroadcastSystemMessage