Post Message for Key
-
Hello all, Please tell me is it possible to send the WM_KEYDOWN message to the program without pressing any key in the keyboard. I want to call a method which has been written in the keydown event without pressing any key for the first time only. Please help me. Many thanks in advance.
-
Hello all, Please tell me is it possible to send the WM_KEYDOWN message to the program without pressing any key in the keyboard. I want to call a method which has been written in the keydown event without pressing any key for the first time only. Please help me. Many thanks in advance.
Yes you can send a WM_KEYDOWN message but it doesn't make a lot of sense. Why don't you instead move that specific code into a separate function that you call from within your key down handler and that you can call directly instead of sending the WM_KEYDOWN message.
Cédric Moonen Software developer
Charting control [v1.4] OpenGL game tutorial in C++ -
Hello all, Please tell me is it possible to send the WM_KEYDOWN message to the program without pressing any key in the keyboard. I want to call a method which has been written in the keydown event without pressing any key for the first time only. Please help me. Many thanks in advance.
You can use the well named (for a change) SendInput funcion. Or rearrange your question to give an answer of "SendMesssage (WM_KEYDOWN,...". But as Cedric said, this is a TERRIBLE idea if you have any sort of access to the software involved. Otherwise there are lots of errors for you to make. If you don't send a matching WM_KEYUP for example, there could be all sorts of "fun" ! Iain.
-
Hello all, Please tell me is it possible to send the WM_KEYDOWN message to the program without pressing any key in the keyboard. I want to call a method which has been written in the keydown event without pressing any key for the first time only. Please help me. Many thanks in advance.
See if this helps: Keyboard events simulation using keybd_event() function[^] SendKeys in C++[^] OnScreen Keyboard[^]
Please leave us our small pleasures, they are small, but they are ours! - Mycroft Holmes ^ .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]