Click to See Complete Forum and Search --> : Locking Keyboard and Mouse


Luc Champoux
February 22nd, 2000, 08:42 AM
Hi,

I need to lock the keyboard and the mouse in one of my application in VB5. And I need to unlock it after the end of a particular process.

Thank you




Luc Champoux

Atlantisoft
February 22nd, 2000, 08:47 AM
lol...."particular process".........this "particular process" wouldn't be a freak-out program designed to scare the victum, would it? lol....go find a hacker forum, this is for good clean programming

gwanders
March 28th, 2000, 06:22 PM
I haven't found a "lock computer" yet but here is a little ditty that will cause the screen saver to be started which will lock the screen if you have that turned on.





Try the following :
open vb
start new standard project
delete form1
open new module
Past the following :

Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long


Sub Main()
Dim result As Long
Const WM_SYSCOMMAND As Long = &H112&
Const SC_SCREENSAVE As Long = &HF140&
result = SendMessage(Form1.hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0&)
End
End Sub


Now go up and create a new form1 (won't be called now but it's handle is needed)


run the code. It should go stright to the screen saver which locks my keyboard and mouse after a couple of seconds......


hope this helps

Andy