zoukankan      html  css  js  c++  java
  • winAPI 检查系统设备拔插使用 WM_DEVICECHANGE 消息

    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();
    }
    }

  • 相关阅读:
    第六次作业
    第五次作业1
    java第三次作业
    JAVA 第二次作业
    JAVA第一次作业
    第 十一 次作业
    第十次作业
    第九次作业
    第八次作业
    第七次作业
  • 原文地址:https://www.cnblogs.com/hqu-ye/p/4832281.html
Copyright © 2011-2022 走看看