ArqPng = Sys(5) + Sys(2003) + "\Erros\" + Transform(Day(Date()), "@L 99") + "_" + ;
transform(Month(Date()), "@L 99") + "_" + ;
transform(Year(Date()), "@L 9999") + "__" + ;
substr(Time(), 1, 2) + "_" + ;
substr(Time(), 4, 2) + ".png"
DO LOCFILE("System.App")
LOCAL loCaptureBmp AS xfcBitmap
WITH _Screen.System.Drawing
loCaptureBmp = .Bitmap.FromScreen(_screen.HWnd)
loCaptureBmp.Save(ArqPng, .Imaging.ImageFormat.Png)
ENDWITH
RELEASE loCaptureBmp
Do While !File(ArqPng) And Lastkey() <> 27
Enddo
Local loForm As Form
Local vAF_Return
vAF_Return = .F.
If _Screen.FormCount > 0
For Each loForm In _Screen.Forms
If loForm.Name <> 'TelaErro'
loForm.Release()
Endif
Endfor
Endif