|
我们是判断是否插入"硬盘2"
LRESULT CXXXXDlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
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, DEVICE_NAME) == 0 ) //是硬盘2
{ //判断到升级u盘
}
}
break;
}
case DBT_DEVICEREMOVECOMPLETE:
break;
default:
break;
}
} |
|