Using GdiPlusX is very simple too, with the advantage that you can do any manipulation if needed, like resizing, saving in any format, reducing quality, saving in Monochrome to save space, etc...
Requires VFP9 and the GdiPlusX library, that can be downloaded from here:
https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=VFPX&ReleaseId=8606* Initialize GdiPlusX
DO SYSTEM.APP
WITH _Screen.System.Drawing
* Capture the form
LOCAL loBmp as xfcBitmap
loBmp = .Bitmap.FromScreen(Thisform)
* Save the image
loBmp.Save("c:\MyCapturedForm.png", .Imaging.ImageFormat.Png)
* Send to the Printer
loBmp.ToPrinter()
ENDWITH
You can capture anything in a form, like a command button or a container too:
loBmp = .Bitmap.FromScreen(Thisform.Container1)
If you want to use the HWND:
loBmp = .Bitmap.FromScreen(Thisform.HWND)
or
loBmp = .Bitmap.FromScreen(Thisform.MyOLEControl.HWND)
Hope this helps
Cesar
>Just a suggestion .. a product called SnagIt by Techsmith is an AWESOME screen capture tool and very reasonably priced. If you're capturing screens to create some kind of documentation, I highly recommend this tool.
>
>
>
>>I used to know how to do it. I remember selecting a form in a running application, pressing Alt Print-Screen, then saving the form image to an email with Ctrl-V
>>
>>I guess I remembered wrong, because that gives me a copy of the whole screen ... not just the selected form.
>>
>>What's the trick?
>>
>>Bob