Mursa Posted July 26, 2013 Share Posted July 26, 2013 Hello, im trying to make script that takes screenshot of certain window every 15 minutes. This is my code atm. #include <ScreenCapture.au3> $var = 0; Do $timer=TimerInit() Sleep(5000) $seconds=Round(TimerDiff($timer)/1000,2) If IsInt($seconds) Then $seconds&=".00" $date = @MDAY & "/" & @MON & "/" & @YEAR _ScreenCapture_Capture("C:\Users\Mursa\Pictures\ProPilk2\" & $var & "_" & $date & ".jpg") Until $var = 10; So basically i'm missing the targeting to certain window. Link to comment Share on other sites More sharing options...
spudw2k Posted July 26, 2013 Share Posted July 26, 2013 I have a script in my signature called ICU that accomplishes (more-or-less) what you are trying to do. I was able to capture a specific window using the following funcs: $activewin = WinGetTitle("") $activewin = WinGetHandle($activewin) _ScreenCapture_CaptureWnd($filename,$activewin) Modify as necessary/ Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
JohnOne Posted July 26, 2013 Share Posted July 26, 2013 You not interested in _ScreenCapture_CaptureWnd ? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mursa Posted July 26, 2013 Author Share Posted July 26, 2013 (edited) #include <ScreenCapture.au3> $activewin = WinGetTitle("Calculator") ;Modified here window Title & didin't work $activewin = WinGetHandle($activewin) _ScreenCapture_CaptureWnd("C:\Users\MYUSER\Pictures\image1.jpg" ,$activewin) Edited July 26, 2013 by Mursa Link to comment Share on other sites More sharing options...
JohnOne Posted July 26, 2013 Share Posted July 26, 2013 "didin't work" I'm afraid you'll have to do a little better than that. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mursa Posted July 26, 2013 Author Share Posted July 26, 2013 I'm afraid you'll have to do a little better than that. Well could you give me helping hand instead of telling that? I'm beginner and wan't go get my code working. ; Autoit window gives me these results on the window ;Title: Pro Pilkki 2 ;Class: MainWClass ;Position: -8,-8 ;Controls > Empty Link to comment Share on other sites More sharing options...
JohnOne Posted July 26, 2013 Share Posted July 26, 2013 Sure, tell us what is not working about it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mursa Posted July 26, 2013 Author Share Posted July 26, 2013 I want to take screenshot of specified window that is not the current window shown. Example my window is down there minimized and i want to take picture at it. Link to comment Share on other sites More sharing options...
JohnOne Posted July 26, 2013 Share Posted July 26, 2013 You cannot take a screenshot of a minimized window. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mursa Posted July 26, 2013 Author Share Posted July 26, 2013 Well, is it possible that it could focus and maximize the window take screenshot and minimize it? Link to comment Share on other sites More sharing options...
Solution JohnOne Posted July 26, 2013 Solution Share Posted July 26, 2013 (edited) Certainly is. WinActivate() should do the trick. EDIT: In fact WinSetState() might be better, for both restoring and minimizing the window. Edited July 26, 2013 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Mursa Posted July 26, 2013 Author Share Posted July 26, 2013 Well how i get back to windows background or to background i came from? Link to comment Share on other sites More sharing options...
Mursa Posted July 26, 2013 Author Share Posted July 26, 2013 Certainly is. WinActivate() should do the trick. EDIT: In fact WinSetState() might be better, for both restoring and minimizing the window. WinSetState() works like charm, ty 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