码迷,mamicode.com
首页 > Windows程序 > 详细

winAPI 检查系统设备拔插使用 WM_DEVICECHANGE 消息

时间:2015-09-23 16:22:57      阅读:234      评论:0      收藏:0      [点我收藏+]

标签:

if(message->message == WM_DEVICECHANGE)
{
/*if (message->wParam == DBT_DEVICEARRIVAL || message->wParam == DBT_DEVICEREMOVECOMPLETE)
{
PDEV_BROADCAST_HDR pHeader = (PDEV_BROADCAST_HDR)message->lParam;
if (pHeader->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
{
hotplug_onSystemDeviceChanged();
}
}*/
//DBT_DEVNODES_CHANGED:: The system broadcasts the DBT_DEVNODES_CHANGED device event when a device has been added to or removed from the system.
//Applications that maintain lists of devices in the system should refresh their lists.
if (message->wParam == DBT_DEVNODES_CHANGED && message->lParam == 0)
{
hotplug_onSystemDeviceChanged();
}
}

winAPI 检查系统设备拔插使用 WM_DEVICECHANGE 消息

标签:

原文地址:http://www.cnblogs.com/hqu-ye/p/4832281.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!