Jump to content
Sign in to follow this  
Delta01

_ScreenCapture_CaptureWnd

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.

Share this post


Link to post
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.

 

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  

×
×
  • Create New...