WINCE下检测SD卡

其实整个做法跟在Win32下没有任何的区别,就是检测USB设备消息。

LRESULT CXXXXXDlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
if ( message == WM_DEVICECHANGE )

switch (wParam)
{
case DBT_DEVICEARRIVAL: //U盘插进来
{
DEV_BROADCAST_HDR* dhr = (DEV_BROADCAST_HDR *)lParam;
PDEV_BROADCAST_PORT lpdbp = (PDEV_BROADCAST_PORT)dhr;
if( lpdbp->dbcp_devicetype == DBT_DEVTYP_PORT )
{
if ( wcsicmp(lpdbp->dbcp_name, TCH_PATH3) == 0 ) //盘符,自己断点看看,我们是CF卡
{ //判断到升级u盘
}
}
break;
}
case DBT_DEVICEREMOVECOMPLETE:
break;
default:
break;
}
}

你可能感兴趣的:(Path,WinCE)