im using keybd_event(); and i want use SendMessage(); to send keystroke to notepad, can this be done?
im using keybd_event(); and i want use SendMessage(); to send keystroke to notepad, can
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
using
SendMessageto insert text into the edit buffer (which it sounds like you want):if you need keycodes and arbitrary keystrokes, you can use
SendInput()(available in 2k/xp and preferred), orkeybd_event()` (which will end up calling SendInput in newer OSs) some examples here:http://www.codeguru.com/forum/showthread.php?t=377393
there’s also WM_SYSCOMMAND/WM_KEYDOWN/WM_KEYUP/WM_CHAR events for SendMessage which you might be interested in.