i want to simulate any key on the keyboard by pressing
ie..i want to type the command on the text box and it should execute it.
actually i need it to type command on another pc on a lan!!!
Any ideas????
Printable View
i want to simulate any key on the keyboard by pressing
ie..i want to type the command on the text box and it should execute it.
actually i need it to type command on another pc on a lan!!!
Any ideas????
Do you mean that when you press the command button you want EVERY single key pressed at the same time?
First, take a look to the code on your own pc! This recent thread gives you a solution by Lord Orwell.
http://forums.vb-world.net/showthrea...threadid=56117
Here's how to press it on your PC (I'm not sure if it works over a LAN)
Code:Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_KEYDOWN = &H100
Private Sub Command1_Click()
'Press the 'A' key
PostMessage hwnd_of_window, WM_KEYDOWN, vbKeyA, 0
End Sub
thanks...the code of virtual keyboard is great!
i hav tried using the keybd_event fr passing commands to ms-dos command prompt but i am not able to do it...sendkeys also doesnt work!
Also if i hav to do the code fr every key on the keyboard then it will take a long time as i hav to again simulate it on the other pc(i will type on 1 pc and it has to execute on other pc)! but will try! Pleas tell me if there is an easier option as i hav to work in limited hours of my college lab!
thanks again,
You'll have to use a remote session if you want to simulate keypresses on another machine.
But don't ask me how, I never did it before.