如何在windows识别某智能卡后运行一个函数

现在在windows下编程,使用PC/SC函数对智能卡进行操作,但只有在智能卡被windows系统识别后,PC/SC函数才会有效。
而智能卡通过usb借口插上之后,需要一段时间才能被识别,即安装好驱动程序。
如何能达到当智能卡被识别之后,就运行我的函数呢?有什么消息吗?

阅读 5.6k
1 个回答

How Do I Detect a Hardware Device Change?

It is very easy to detect this change, because the operating system will send a WM_DEVICECHANGE message to the application when a device change is detected. All we need to do is handle this message in the window procedure of the application.

From: Detecting USB Device Insertion and Removal Using Windows API <PDF>

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进