Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Screen capture
Message
From
13/09/2005 18:02:47
 
 
To
13/09/2005 17:57:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01049252
Message ID:
01049258
Views:
15
This message has been marked as the solution to the initial question of the thread.
>We all know that holding down the alt key and pressing print screen will capture a screenshot to the clipboard. But, is there a way to do that programatically? I have found nothing in VFP that will allow me to do it, but I thought I'd put this in front of the experts before I discard the idea. . . . just in case.
*
* Declare API call
*
DECLARE INTEGER keybd_event IN Win32API ;
        INTEGER, INTEGER, INTEGER, INTEGER
*
* Do an Alt-Printscreen
*
#DEFINE VK_LMENU 164
#DEFINE VK_SNAPSHOT 44
#DEFINE KEYEVENTF_EXTENDEDKEY 1
#DEFINE KEYEVENTF_KEYUP 2
DOEVENTS
keybd_event( VK_LMENU,    0, KEYEVENTF_EXTENDEDKEY, 0 )  && key down
INKEY(0.01)
keybd_event( VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0 )
INKEY(0.01)
keybd_event( VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0 )
INKEY(0.01)
keybd_event( VK_LMENU,    0, KEYEVENTF_EXTENDEDKEY + KEYEVENTF_KEYUP, 0 )
DOEVENTS
I've found I need the INKEY() statements in order for it to work reliably.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform