Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending keystrokes to non VFP windows
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00158751
Message ID:
00161298
Views:
33
>Here are some reasons that, IMO, say that keybd_event is better than SendMessage:
>
>- The bits 25-28 of the lParam for WM_KEYDOWN, WM_KEYUP, WM_CHAR, WM_SYSKEYDOWN, WM_SYSKEYUP messages are reserved. So, you don't know what their value should be.
>- Simulating the ALT key involves WM_SYSKEYDOWN and WM_SYSKEYUP. Not big deal, but one more special case.
>- Some keys generate a WM_CHAR message, some don't. Which ones do, which don't?
>
>Anyway, the keyboard messages are generated using PostMessage, not SendMessage. (PostMessage doesn't wait for an answer, while SendMessage waits for it.)
>
>And all these are already handled in a standard way by keybd_event()! One more reason: the keyboard drivers use internally keybd_event and not PostMessage directly.
>
>Any advantage in using PostMessage vs. keybd_event?
>
Hi Vlad,

You've raised a number of interesting points. Unfortunately, without doing some research, I don't have either an answer or a counter point. Perhaps someone else does. I'll try to do some of the research today, and, hopefully, maybe someone will offer some additional information.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform