zzacreek Posted November 5, 2009 Posted November 5, 2009 i have created a program that takes a screen capture of a program. i used the fallowing command: _ScreenCapture_CaptureWnd ("C:\work\FundlinxPB730\Auto_Scripts\ddsecure_test\test1\test\base1.jpg", $hGUI,0,0,-1,-1,false) however each time the program runs and saves off the base1.jpg the image is different and the size of the image is different. Which leads to my test failing because of the image not being the same? My screen settings are the same? So i don't know what i am doing wrong? is there a better way to test a screen to make sure it is the same?
Yashied Posted November 5, 2009 Posted November 5, 2009 (edited) What is $hGUI? It would be a good idea from you to give us an example of your code for the test. And welcome to the forum. Edited November 5, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
zzacreek Posted November 6, 2009 Author Posted November 6, 2009 here is the full code: WinActivate("FUNDLinx Security Manager © Delta Data Software, Inc.") $hGUI = WinGetHandle("FUNDLinx Security Manager © Delta Data Software, Inc.") Sleep(500) _ScreenCapture_CaptureWnd ("C:\work\FundlinxPB730\Auto_Scripts\ddsecure_test\test1\test\base1.jpg", $hGUI,0,0,-1,-1,false) from some reason the picture is not the same size each time this code runs?
Authenticity Posted November 6, 2009 Posted November 6, 2009 (edited) Are you using Vista? If so, it may be that the glass theme is causing the effect to be different from run to run but on the same run the files are same size:#include <ScreenCapture.au3> Run("calc.exe") WinWaitActive("[CLASS:SciCalc]") Sleep(500) _ScreenCapture_CaptureWnd(@ScriptDir & "\test.jpg", WinGetHandle("[CLASS:SciCalc]"), 0, 0, -1, -1, False) Sleep(1000) _ScreenCapture_CaptureWnd(@ScriptDir & "\test1.jpg", WinGetHandle("[CLASS:SciCalc]"), 0, 0, -1, -1, False)Edit: A solution to this might be to get the rect of the client area using _WinAPI_GetClientRect() create two points (i.e DllStructCreate($tagPOINT)) for [left, top] and [right, bottom] and call _WinAPI_ClientToScreen() and call _ScreenCapture_Capture() with the translated coordinates. Edited November 6, 2009 by Authenticity
zzacreek Posted November 6, 2009 Author Posted November 6, 2009 I am not using vista i am using XP. The really odd thing is that when i run the script outside of scheduled task it works fine. But when the task is scheduled in windows it takes different screen shoots then it does when it is not scheduled? Another thing is what other settings are needed to make screen shoots the same across different computers? I have the screen resolution the same on two different computers. However the image they produce is different in size. But the picture itself looks the same? I shall try what you said. i use script writer to write some of the test how do i take screen shoots with it? thanks
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