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

Posted on 2012-08-13
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.
Question by:busycoder
    LVL 41

    Expert Comment

    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 ( or some other similar software.

    You may also call PrintWindowAPI directly:

    It is also described here:
    LVL 29

    Accepted Solution

    Use GDIPlusX from VFPX at Codeplex. Then it's three lines:

    DO (LOCFILE(""))
    oBMP = _SCREEN.System.Drawing.Bitmap.FromScreen(_SCREEN.HWnd)

    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.

    Author Closing Comment

    Very cool stuff I can't believe I haven't run across this yet. Thanks a ton!

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    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://msd…
    It Is not possible to enable LLDP in vSwitch(at least is not supported by VMware), so in this article we will enable this, and also go trough how to enabled CDP and how to get this information in vSwitches and also in vDS.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now