keypress in dialog form


I want to control robot, using keyboard, for example if I press s the robot will move forward, z will move backward.

I use visual studio 2010, class library, with dialog form

but I have tried and not working.

can some one give me an idea?
On Windows: GetAsyncKeyState and this
Thx Vidminas,

but in my program I cannot include window.h
it says intellisense can not include window.h
Maybe because it's #include <windows.h> and you just misspelt it?

It's windows.h not window.h
Last edited on
yes you r right I misstype :))

thank you..

I try it tommorow because my real program is in the office. :)
And by the way as an example for Z and S:
for S if (GetAsyncKeyState(0x53) != 0) //code to move forward
for Z if (GetAsyncKeyState(0x5A) != 0) //code to move back
Thank you .. you solve my problem
Topic archived. No new replies allowed.