snappy Posted July 17, 2008 Share Posted July 17, 2008 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. Thanks. Here is the script: #include <ScreenCapture.au3> #include <Debug.au3> _Main() Func _Main() local $h AutoItSetOption("WinTitleMatchMode", 2) $h = WinGetHandle("AutoIt Help") If @error Then MsgBox(4096, "Error", "Could not find the correct window") Exit(1) EndIf _ScreenCapture_CaptureWnd(@MyDocumentsDir & "\testing.bmp", $h) EndFunc ;==>_Main Link to comment Share on other sites More sharing options...
NELyon Posted July 17, 2008 Share Posted July 17, 2008 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. Link to comment Share on other sites More sharing options...
snappy Posted July 17, 2008 Author Share Posted July 17, 2008 Got it working now, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now