Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » warning users about USB drives?
Closed Thread
Old 06-05-2006, 04:03 AM   #1 (permalink)
 
Newb Techie

Join Date: Aug 2005

Posts: 20

hargi22

Default warning users about USB drives?

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
hargi22 is offline  
Old 06-05-2006, 05:33 PM   #2 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default

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
office politics is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On