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:
00160147
Views:
27
>And here's the code if you want a snapshot of the active window only:
>
>
VK_SNAPSHOT     = 0x2C
>VK_MENU         = 0x12
>KEYEVENTF_KEYUP = 0x0002
>
>DECLARE keybd_event IN Win32API ;
>	INTEGER nVirtualKey, ;
>	INTEGER nScanCode, ;
>	INTEGER nFlags, ;
>	INTEGER nExtraInfo
>	
>= keybd_event(VK_MENU, 0, 0, 0)
>= keybd_event(VK_SNAPSHOT, 0, 0, 0)
>= keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0)
>= keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0)
>
>Please note that the help on keybd_event is wrong and
>
>keybd_event(VK_SNAPSHOT, 1, 0, 0)
>
>doesn't take a snapshot of the active window, but a snapshot of the whole screen. Maybe this is what you tried and didn't work.
>
Hi Vlad,

I think you misunderstood me. In fact, I think I've posted the same information in the past. I've never had trouble getting a snapshot into the clipboard, it was sending the keystrokes to another window, which, as you've seen, I figured out with your help.

Yeah, the docs are wrong (at least the 1997 docs, haven't checked the 1998 ones, though), and I've know this too. 0 gets the active window and 1 takes full screen.

Kind Regards,
George

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

Click here to load this message in the networking platform