您的位置:首页 > 其它

USB设备插入/拔出时重要的windows消息值

2013-12-20 16:11 363 查看
设备变更时,会收到WM_DEVICECHANGE消息

public const int WM_DEVICECHANGE = 0x219;

在收到WM_DEVICECHANGE消息,判断wordparm的值对比下面的常量,判断具体操作

public const int DBT_DEVICEARRIVAL = 0x8000;

public const int DBT_CONFIGCHANGECANCELED = 0x0019;

public const int DBT_CONFIGCHANGED = 0x0018;

public const int DBT_CUSTOMEVENT = 0x8006;

public const int DBT_DEVICEQUERYREMOVE = 0x8001;

public const int DBT_DEVICEQUERYREMOVEFAILED = 0x8002;

public const int DBT_DEVICEREMOVECOMPLETE = 0x8004;

public const int DBT_DEVICEREMOVEPENDING = 0x8003;

public const int DBT_DEVICETYPESPECIFIC = 0x8005;

public const int DBT_DEVNODES_CHANGED = 0x0007;

public const int DBT_QUERYCHANGECONFIG = 0x0017;

public const int DBT_USERDEFINED = 0xFFFF;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息