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:
00160253
Views:
31
>>Thanks. The one thing I found out was that using the CAPSLOCK() function to toggle the key state wasn't reliable.
>
>Ha! Now I see that CAPSLOOK can be used to set the caps status, not only to get it! Thanks! Why is it unreliable? It works for me.

When I was goofing around I used = CAPSLOCK(.F.) to make sure that it was when it was set to on. It seems (and I admittedly haven't tested this as well as I should), that VFP lags behind itself. While I haven't looked into it closely enough to know for sure, it seemed that VFP executed the statement, then the code that followed. When I looked at the keyboard afterward, caps lock was still on, and the debugger said that CAPSLOCK() was .F. Strange, but I think I may be guilty of some bad (computer) science here. Turn capslock on, insert = CAPSLOCK(.F.) and see what you come up with in my code sample.

>>I've just finished reading one of Vlad's posts and he makes some excellent points on sending the key codes. I'm gonna take (steal?:-)) some of his stuff, and work some more with this during the coming week.
>
>Take it, take it! There's nothing to steal there! :))

There's a saying that goes along the lines of the good borrow, the great steal.:-) I try to steal as much as I can, but always try to credit those I've stolen from.

>>Maybe get around to playing with SendMessage(). I think using the keybd_event() is not esthetically pleasing.
>
>Why "not esthetically pleasing"? IMHO, the "keybd_event" name is self-documented, while SendMessage is not, in this case.
>
I just don't like having to do all that window manipulation stuff to make it work. I'd rather it be unobtrusive to the user, that's all. You're right. The name of "keybd-event" is self-documenting.
George

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

Click here to load this message in the networking platform