Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Idle Time In Vb.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hai Friends,
In my project i have to make the user log out of the machine, if there is no Keyboard or mouse input after a specified period of time.
Using the GetAsynKeyState Api i was able to achive this , I have a problem in this, If the User is in DOS Prompt, GetAsynKeyState api traps the key stroke if OS is NT /2000, But if the OS is 98 it does not Trap the Key Stroke.
Please guide me. Or

Is there any other way to Find the system Idle time.


Thanks & Rgds ,
Chander
 
There are several issues with using GetAsynKeyState API to monitor the keyboard. Instead, you should be monitoring the OS event message queue. Look at using the SetWindowsHookEx in order to hook into the event queue to trap keypresses. If you want to monitor every process, the callback function will need to be in a C++ DLL. - Jeff Marler B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top