Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending keystrokes to non VFP windows
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00158751
Message ID:
00161298
Vues:
35
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform