Computers |
|
| | #1 (permalink) |
| Newb Techie Join Date: Aug 2005
Posts: 20
| hi, Is there a way of alerting the user that they have left there memory stick/keydrive in the computer when they log off there computer, we use novell login system, if it is posible what language is best to write it in thanks in advance |
| | |
| | #2 (permalink) |
| Dope Tech | i believe SP_DEVICE_INTERFACE_DATA will be able to detect usb devices visual c++ http://www.codeguru.com/forum/archiv.../t-273081.html Code: the code about usb
// find usb device
SP_DEVICE_INTERFACE_DATA strtInterfaceData;
BOOL bSuccess = SetupDiEnumDeviceInterfaces(hDevInfo,NULL,&guidHID,0,
&strtInterfaceData);
if (!bSuccess)
{
m_strLog += _T("sorry,cant find usb device");
SetupDiDestroyDeviceInfoList(hDevInfo);
return;
}
//if there is usb device,then read it's directory
SP_DEVICE_INTERFACE_DETAIL_DATA strtDetailData;
if (!SetupDiGetDeviceInterfaceDetail(hDevInfo,&strtInterfaceData,
&strtDetailData,sizeof(strtDetailData),NULL,NULL))
{
AfxMessageBox(_T("error when get usb's directory"));
SetupDiDestroyDeviceInfoList(hDevInfo);
return;
} __________ http://www.codecomments.com/message577741.html __________ http://www.alanmacek.com/usb/usb.c
__________________ Tech IMO.com | ExtremeTech.com | ASP Free.com | SysOpt.com | Tech Support Guy.org DB Forums.com | Cyber Tech Help.com | Lazy Forums.com | Warrior Nation.net 'If you don't stand for somethin you'll fall for anything' - Dr. Dre Been there, done that |
| | |