Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Screen grab in on error
Message
De
14/09/2010 06:08:36
 
 
À
14/09/2010 05:51:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01481086
Message ID:
01481089
Vues:
43
Thank Tore

I'll try it out

>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform