cotax Posted April 25, 2010 Share Posted April 25, 2010 (edited) Hi, i got a little problem, ive made a script to instal and configure fraps. now everyting runs fine, but the problem is: when it opens c:\fraps\fraps.exe the programs starts, but the window is not selected so the script will not execute. When i press anywhere in/on the program the script wil take over and do what it need to do. how can i get it that when it starts fraps the window is selected / Highlighted so the script will run directly without pressing the window first? Edited April 25, 2010 by cotax Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 25, 2010 Moderators Share Posted April 25, 2010 cotax,Look at WinActivate and WinWaitActive in the Help file. These commands will let you activate the window (as if you clicked on it) and then pause the script until the window is actually active. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
cotax Posted April 25, 2010 Author Share Posted April 25, 2010 this is what i use, it works great, but the only thing is i need to click te window before it starts offcourse i can at a mouseclick in it, but it needs to do it on it self. any idea's? Run("C:\Fraps\fraps.exe") WinActivate("FRAPS general") WinWaitActive("FRAPS general", "") ControlClick("FRAPS general", "", "[CLASS:Button; INSTANCE:3]") ControlClick("FRAPS general", "", "[CLASS:Button; INSTANCE:4]") ControlClick("FRAPS general", "", "[CLASS:Button; INSTANCE:5]") ControlClick("FRAPS general", "", "[CLASS:Button; INSTANCE:8]") WinActivate("FRAPS fps") WinWaitActive("FRAPS fps") ControlClick("FRAPS fps", "", "[CLASS:Button; INSTANCE:8]") ControlClick("FRAPS fps", "", "[CLASS:Button; INSTANCE:14]") WinActivate("FRAPS movies") WinWaitActive("FRAPS movies") ControlClick("FRAPS movies", "", "[CLASS:Button; INSTANCE:12]") ControlClick("FRAPS movies", "", "[CLASS:Button; INSTANCE:13]") WinActivate("FRAPS screenshots") WinWaitActive("FRAPS screenshots") ControlClick("FRAPS screenshots", "", "[CLASS:Button; INSTANCE:8]") WinSetState("FRAPS general", "", "@SW_MINIMIZE") Link to comment Share on other sites More sharing options...
cotax Posted April 25, 2010 Author Share Posted April 25, 2010 //Edit adding a mouse click wont work, becouse when fraps is opened it selects an other window (whats running on background)so it just selects a window but fraps itself wont stay active, thats wy i need to manually click the window.i really want this resolved, so if anyone can help me out with this, it would be verry nice. Link to comment Share on other sites More sharing options...
MHz Posted April 25, 2010 Share Posted April 25, 2010 You are using Control*() functions so you may not need to try and activate the windows. Give this a try: Run("C:\Fraps\fraps.exe") WinWait("FRAPS general") ControlClick("FRAPS general", "", "Button3") ControlClick("FRAPS general", "", "Button4") ControlClick("FRAPS general", "", "Button5") ControlClick("FRAPS general", "", "Button8") WinWait("FRAPS fps") ControlClick("FRAPS fps", "", "Button8") ControlClick("FRAPS fps", "", "Button14") WinWait("FRAPS movies") ControlClick("FRAPS movies", "", "Button12") ControlClick("FRAPS movies", "", "Button13") WinWait("FRAPS screenshots") ControlClick("FRAPS screenshots", "", "Button8") WinSetState("FRAPS general", "", "@SW_MINIMIZE") FYI, your previous script would possibly need WinWait() as well just before using WinActivate() normally except for an inactive FRAPS as you mention. Link to comment Share on other sites More sharing options...
cotax Posted April 25, 2010 Author Share Posted April 25, 2010 @ MHz Thanks alot this works verry well I dont get it why my script doesnt work at the start. and u use WinWait("FRAPS fps") ControlClick("FRAPS fps", "", "Button8") ControlClick("FRAPS fps", "", "Button14") to go to next window but how does it works? normally u need to activate the window right? WinActivate("FRAPS fps") but how does it know that it needs to go to the "FRAPS fps" tab? becouse at this point u only say winwait. or it doesnt care becouse i said control click on that page? again thanks alot, ur script works great. u dont need too but if u can explain it to me, it would be verry usefull. 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