Speedmaster Posted March 15, 2011 Share Posted March 15, 2011 Thanks in advance for the help already given! I'm tinkering with the recording functionality (against the Windoze calculator) and am running into two things, likely related. 1. What is the best mechanism for making sure the window I want is always in focus? As I replay a script sometimes it works, sometimes my recorded keystrokes get sent to the Windows desktop. What function(s) should I use to set a window properly? 2. Does it make sense to have the mouse coordinates be relative to the application window in focus, instead of the entire Windows screen? If so, how do I make that happen? I did see this at the top of one of the scripts I recorded: Opt("MouseCoordMode",0) 3. Is it safe to assume that mouse drag options are best avoided? Thanks again, guys! Chrs ChrisInterested in economics, watches, or pens? If so, check out my blog. Link to comment Share on other sites More sharing options...
DW1 Posted March 15, 2011 Share Posted March 15, 2011 If you can, use controlclick() instead of mouseclick() With control click, the window can be hidden or minimized. You don't need to "use" the users mouse, just simulate the click without interference. $Pid = Run("calc.exe") WinWait("[Class:CalcFrame]", "") ControlClick("[Class:CalcFrame]", "", "[CLASSNN:Button5]") ControlClick("[Class:CalcFrame]", "", "[CLASSNN:Button11]") ControlClick("[Class:CalcFrame]", "", "[CLASSNN:Button16]") AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Speedmaster Posted March 15, 2011 Author Share Posted March 15, 2011 Thanks, Dan. Were you able to somehow record those steps, or did you have to hand code them? If you can, use controlclick() instead of mouseclick() With control click, the window can be hidden or minimized. You don't need to "use" the users mouse, just simulate the click without interference. $Pid = Run("calc.exe") WinWait("[Class:CalcFrame]", "") ControlClick("[Class:CalcFrame]", "", "[CLASSNN:Button5]") ControlClick("[Class:CalcFrame]", "", "[CLASSNN:Button11]") ControlClick("[Class:CalcFrame]", "", "[CLASSNN:Button16]") ChrisInterested in economics, watches, or pens? If so, check out my blog. Link to comment Share on other sites More sharing options...
DW1 Posted March 15, 2011 Share Posted March 15, 2011 (edited) I hand coded them. You could automate the process with the winapi functions though.Take a look Edited March 15, 2011 by danwilli AutoIt3 Online Help 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