WM_DEVICECHANGE message
来源:互联网 发布:软件破解教程 编辑:程序博客网 时间:2024/05/20 04:30
msdn:http://msdn.microsoft.com/en-us/library/windows/desktop/aa363480%28v=vs.85%29.aspx
otifies an application of a change to the hardware configuration of a device or the computer.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(HWND hwnd, // handle to window UINT uMsg, // WM_DEVICECHANGE WPARAM wParam, // device-change event LPARAM lParam ); // event-specific data
Parameters
- hwnd
A handle to the window.
- uMsg
The WM_DEVICECHANGE identifier.
- wParam
The event that has occurred. This parameter can be one of the following values from the Dbt.h header file.
Value Meaning - DBT_CONFIGCHANGECANCELED
- 0x0019
A request to change the current configuration (dock or undock) has been canceled.
- DBT_CONFIGCHANGED
- 0x0018
The current configuration has changed, due to a dock or undock.
- DBT_CUSTOMEVENT
- 0x8006
A custom event has occurred.
- DBT_DEVICEARRIVAL
- 0x8000
A device or piece of media has been inserted and is now available.
- DBT_DEVICEQUERYREMOVE
- 0x8001
Permission is requested to remove a device or piece of media. Any application can deny this request and cancel the removal.
- DBT_DEVICEQUERYREMOVEFAILED
- 0x8002
A request to remove a device or piece of media has been canceled.
- DBT_DEVICEREMOVECOMPLETE
- 0x8004
A device or piece of media has been removed.
- DBT_DEVICEREMOVEPENDING
- 0x8003
A device or piece of media is about to be removed. Cannot be denied.
- DBT_DEVICETYPESPECIFIC
- 0x8005
A device-specific event has occurred.
- DBT_DEVNODES_CHANGED
- 0x0007
A device has been added to or removed from the system.
- DBT_QUERYCHANGECONFIG
- 0x0017
Permission is requested to change the current configuration (dock or undock).
- DBT_USERDEFINED
- 0xFFFF
The meaning of this message is user-defined.
- lParam
A pointer to a structure that contains event-specific data. Its format depends on the value of thewParam parameter. For more information, refer to the documentation for each event.
Return value
Return TRUE to grant the request.
Return BROADCAST_QUERY_DENY to deny the request.
Remarks
For devices that offer software-controllable features, such as ejection and locking, the system typically sends aDBT_DEVICEREMOVEPENDING message to let applications and device drivers end their use of the device gracefully. If the system forcibly removes a device, it may not send aDBT_DEVICEQUERYREMOVE message before doing so.
Requirements
Minimum supported client
Minimum supported server
Header
- Winuser.h (include Windows.h or Dbt.h)
See also
- DBT_CONFIGCHANGECANCELED
- DBT_CONFIGCHANGED
- DBT_CUSTOMEVENT
- DBT_DEVICEARRIVAL
- DBT_DEVICEQUERYREMOVE
- DBT_DEVICEQUERYREMOVEFAILED
- DBT_DEVICEREMOVECOMPLETE
- DBT_DEVICEREMOVEPENDING
- DBT_DEVICETYPESPECIFIC
- DBT_DEVNODES_CHANGED
- DBT_QUERYCHANGECONFIG
- DBT_USERDEFINED
- WM_DEVICECHANGE message
- WM_DEVICECHANGE
- WM_DEVICECHANGE使用方法
- WM_DEVICECHANGE使用方式
- 深入了解WM_DEVICECHANGE消息
- WM_DEVICECHANGE使用方式
- WM_DEVICECHANGE使用方式
- WM_DEVICECHANGE看别人的东东
- HOOK 钩子拦截WM_DEVICECHANGE消息
- vc++中WM_DEVICECHANGE消息函数
- 检测设备状态(WM_DEVICECHANGE)
- VC中添加WM_DEVICECHANGE消息
- HOOK 钩子拦截WM_DEVICECHANGE消息
- vc里面添加WM_DEVICECHANGE消息
- 使用HOOK 拦截 WM_DEVICECHANGE消息
- WM_DEVICECHANGE实现USB设备热插拔
- message
- message
- js ajax - mark
- Storm-源码分析汇总
- 当我达到光速
- MQ消息中间件
- VS2010 + Qt5.3.2 中文显示乱码的问题.
- WM_DEVICECHANGE message
- 设计模式6——适配器模式
- matlab 的括号
- stm32SysTick(补充)
- 用 VNC 远程图形化登录 Linux (VNC 全屏显示,F8切换全屏)
- case when和decode比较
- C++ 对象中的方法:getline
- spark源码解读
- 黑马程序员——OC语言(一)--基本语法