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:
00159556
Views:
30
>>You probably know more about that than I do.:-)
>
>Nope, I was just shooting from the hip. If you've tried it and it doesn't work, then it doesn't work. :)

Not so fast there Mark.< g > I've never been able to make this work with keybd_event(). That by no means indicates that it can't be done from VFP. I've followed more than one "blind" lead, thinking, "Nope can't do it," only to find out later that it can be done, and I was just doing something very stupid. Probably done it more times than most. I have, for example, used it to get Print Screen to the clipboard, this, however, no go. Maybe Vlad Tatavu or one of the other C++ guys (I'm C++ illiterate) can point out how.

>>The only way I could get anything sent to another app was to, first ShowWindow(), followed by SetActiveWindow(), followed by SetForegroundWindow(). Not good.
>
>That's better than nothing! Again, I did my testing with a Win 98 beta, and the problems I was seeing probably don't exist anymore (though they may reappear in NT 5). Since my goal was simply to paste data into whatever program was active, it really didn't matter.

Well, I'm using Win98 release, and it's there, and the docs indicate that it'll be in NT too.

>> Have you looked at the possibility (in VC++ or VFP) of using SendMessage() to do this. I glanced at it, but haven't had time to pursue it.
>
>I was unsuccessful with this. If memory serves (never a foregone conclusion), it wasn't possible to send messages to a window not in the current thread (originally I just wanted to send the "paste" message to the current app). This is a way that Win 98 tries to prevent programs from screwing each other.
>
>But, again, it's been a while...

I'm gonna look at it. My first reaction was that it would be more trouble than it's worth. I'll keep your remarks in mind, however.

Thanks,
George

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

Click here to load this message in the networking platform