Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Want to be able to capture a non foxpro window to a file (bmp)

Posted on 2012-08-13
3
Medium Priority
?
728 Views
Last Modified: 2012-08-21
I want to be able to do what alt-print screen does, and I can do this if it is a foxpro form, but not if the window is outside of foxpro. i would also like to be able to capture a part of a screen if I pass the coordinates to capture.
0
Comment
Question by:busycoder
3 Comments
 
LVL 43

Expert Comment

by:pcelba
ID: 38288470
So if you would like to capture a non-FoxPro window or a part of the screen from VFP program then you could use some SnagIt API or SnagIt COM Server (http://assets.techsmith.com/docs/pdf-snagit/Snagit-11-COM-Server-Documentation.pdf) or some other similar software.

You may also call PrintWindowAPI directly: http://msdn.microsoft.com/en-us/library/windows/desktop/dd162869(v=vs.85).aspx 

It is also described here: http://www.news2news.com/vfp/?example=158
0
 
LVL 30

Accepted Solution

by:
Olaf Doschke earned 2000 total points
ID: 38288480
Use GDIPlusX from VFPX at Codeplex. Then it's three lines:

DO (LOCFILE("system.app"))
oBMP = _SCREEN.System.Drawing.Bitmap.FromScreen(_SCREEN.HWnd)
oBmp.Save("screen.bmp",.Imaging.ImageFormat.Bmp)

Put in 0 instead of _SCREEN.HWnd to get the a desktop screenshot, or any windows hwnd for any other applications window. You can also save as PNG or JPG, anything Windows GDI+ supports.

You can of course cut out an area before saving, etc. GDIPlusX comes with samples helping you to do more, as you like.

Bye, Olaf.
0
 

Author Closing Comment

by:busycoder
ID: 38316204
Very cool stuff I can't believe I haven't run across this yet. Thanks a ton!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
The number of companies understanding the potential of IoT on B2B market is growing with each day. And yet only a small share of IoT developers have managed to equalize incomes and stay competitive in the international market.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question