Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Screen grab in on error
Message
From
14/09/2010 05:51:38
 
 
To
14/09/2010 05:25:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01481086
Message ID:
01481088
Views:
63
This function will put the current program in the buffer. I hope it will give you some help.
Function ScreenShot
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
Use this function to save the clipboard to a jpg file, requires gdiplusx
Function saveclipasjpg
   Lparameters pcFilename
   Local llReturn, loBMP
   If Pcount()=0 Or Vartype(pcFilename)#'C'
      pcFilename="ClipImage"
   Endif
   pcFilename=Forceext(pcFilename,'jpg')
   Erase (pcFilename)
   If clipIsImage() &&Len(_cliptext)=0
      If !type('_screen.system')='O'
         Do prog\gdiplusx\app\system.app && change the path if necessary
      Endif
      With _SCREEN.System.Drawing
         loBmp = .Bitmap.FromClipboard()
         loBMP.Save(pcFilename, .Imaging.ImageFormat.Jpeg) 
      Endwith 
   Endif
Return filesize(pcFilename)>0
>Hi
>
>in my on error routine it would be useful for me to grab the screen contents and include them or a link to them in my stored error details.
>
>Any ideas on a way I could do that.
>
>Thanks
>
>NIck
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform