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:
00160147
Vues:
32
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform