Jump to content
Sign in to follow this  

Screen Capture

Recommended Posts


First of all the setup for this code is simple. I have the autoit IDE open, and the autoit help window open. I click go in the IDE, and I get a screen capture

of the IDE window (not the help window) at the gemoetry of the help window. So the handle is definitely that of the Help window, but it's not capturing

the help window. Does the help window need to be restored/shown on desktop before it actually performs the capture?

If I do need to display the window on the desktop, can anyone recommend which function I use.


Here is the script:

#include <ScreenCapture.au3>
#include <Debug.au3>


Func _Main()
    local $h
    AutoItSetOption("WinTitleMatchMode", 2)
    $h = WinGetHandle("AutoIt Help")
    If @error Then
        MsgBox(4096, "Error", "Could not find the correct window")

    _ScreenCapture_CaptureWnd(@MyDocumentsDir & "\testing.bmp", $h)
    EndFunc  ;==>_Main

Share this post

Link to post
Share on other sites

Yes, the window must be activated.

_ScreenCapture_CaptureWnd doesn't actually do anything fancy to capture that window. It simply does a normal _ScreenCapture_Capture after getting the parameters of the window you are looking for, so if there is a window above it, it has no way of knowing that. It simply takes a screenshot in that area.

Share this post

Link to post
Share on other sites

Got it working now, thanks.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this