Jump to content

_ScreenCapture_CaptureWnd


Delta01
 Share

Recommended Posts

Hi,

I'm making a simple screenshot script, with a few options etc etc. But, I'm having a problem with taking and saving an image of a window. All it does saves a 1x1 pixel image, doesn't save a screenshot of the window.

My code is

#include <ScreenCapture.au3>
WinActivate("AutoIt Help")
sleep(500)
$SsTake = _ScreenCapture_CaptureWnd("", "AutoIt Help", -1, -1, -1, -1)
_ScreenCapture_SaveImage(@ScriptDir & "\Test.jpg", $SsTake)

I have the latest beta.

Any help would be appreciated, thanks.

Link to comment
Share on other sites

You need to read up on what an handle to the window is....

#include <ScreenCapture.au3>
WinActivate("AutoIt Help")
$hWnd = WinGetHandle("AutoIt Help")
Sleep(500)
$SsTake = _ScreenCapture_CaptureWnd("", $hWnd)
_ScreenCapture_SaveImage(@ScriptDir & "\Test.jpg", $SsTake)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...