首页 相关文章 Vc U盘插入检测

Vc U盘插入检测

参考MSDN例子:Detecting Media Insertion or Removal

响应WM_DEVICECHANGE 消息:

BOOL OnDeviceChange( UINT nEventType, DWORD dwData )
{

PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)dwData; // struct transform
PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME)lpdb;

switch (nEventType)
{

case DBT_DEVNODES_CHANGED:
...

break;

case DBT_DEVICEARRIVAL: // device arrival

if(GetDriveType(UDriveName)==DRIVE_REMOVABLE)
{

........

}
else
{

.......[ 查看全文 ]

2016-02-19 标签:

Vc U盘插入检测的相关文章

手机页面
收藏网站 回到头部