扫描U盘
编辑器加载中...int CSendUDiskDlg::SearchUDisk(void)
{
int nCount, i;
char szDriver[3];
nCount = 0;
szDriver[1] = ':';
szDriver[2] = 0;
for (i = 'C'; i <= 'Z'; i++)
{
szDriver[0] = i;
UINT uType = GetDriveType(szDriver);
if (uType == DRIVE_REMOVABLE)
{
m_cmbUDisk.AddString(szDriver);
nCount++;
}
}
m_cmbUDisk.SetCurSel(nCount > 0 ? 0 : -1);
GetDlgItem(IDOK)->EnableWindow(nCount > 0);
return nCount;
}