nxs Posted September 19, 2007 Share Posted September 19, 2007 The company I work for uses a licensed bespoke exe that is no longer supported by the supplier. It is a windows GUI that reads files that appear in its input directory, and writes responses to it's output directory. It runs on Windows 2003 Server in the computer room. The problem is, that it occasionally fails to respond, and needs to be restarted manually by the operators. I thought, I would use a bit of initiative, and automate the restart when necessary using autoit. I got it working quickly, and was very impressed with this tool! I told everyone at work how good it was, and how the ops guys wouldn't need to be called out at night etc. I set it up restarting on the test box every 30 seconds and sat back to watch it with a contented smile on my face. Then the screen saver lock cut in, I typed the password and aargh, it had failed on a mouse click! I have read various threads pointing out that this is not a bug, and i understand. The answer is to use Control Click. The trouble is that Au3Info doesn't see one particular group of buttons, so I clicked them by coordinate. When you use the GUI manually, you can't tab to these buttons, or use Alt <whatever> either. The buttons appear to be images with a bevel around them and they repond to a mouse click using any mouse button, and appear to 'go in'. I guess that they may be 'Custom Controls' ? I down loaded the vb decompiler lite, and tried it on the exe - bingo, it is vb! I say bingo, but I am not a windows or vb programmer, and the lite decompiler doesn't do everything. There are some procedures that look relevent, but I don't know if thay are accessible by autoit? So, I seem to be at a dead end. It is mandatory to have timed locking screensavers on all windows servers in the company. I am on the point of giving up - no one asked me to do it in the first place! Is there anyone out there who could nudge me in the right direction? Link to comment Share on other sites More sharing options...
herewasplato Posted September 19, 2007 Share Posted September 19, 2007 Welcome to the forum.I could not tell for sure from your post if you tried:ControlClick("title", "text", "", "left", 1, x, y)Leave the control info as "". [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
nxs Posted September 19, 2007 Author Share Posted September 19, 2007 Thanks!Just tried it - nothing happens.A play with the coordinates shows that it is clicking the bottom left Normal Buttonprovided x,y are less than its width/height.That is the button with the first tab order.Here is a bit of ascii art ____________________________| . . . Window Title . . . ||__________________________||____________ ____________ ||| Image . .| | Image . .| ||| button 1 | | Button 2 | |||__________| |__________| ||____________ ___________ ||| Image . .| | Image . .| ||| button 3 | | Button 4 | |||__________| |__________| || ___________ ___________ ||| Normal . | | Normal . | ||| Button . | | Button . | ||| Exit . . | | Admin . .| |||__________| |__________| ||__________________________| Link to comment Share on other sites More sharing options...
Nahuel Posted September 19, 2007 Share Posted September 19, 2007 I'm sure that you don't want to click it by coordinates, but setting coordinates relative to the 'Window Title' window can make it work better. Opt("MouseCoordMode",2) Or maybe clicking by pixel color? Interesting problem you have, hehe. Link to comment Share on other sites More sharing options...
herewasplato Posted September 19, 2007 Share Posted September 19, 2007 ...A play with the coordinates shows that it is clicking the bottom left Normal Buttonprovided x,y are less than its width/height...I've not used the x,y parm for ControlClick, but maybe you can use real control info from one of your "real" control/buttons and play with the x,y parm to see if you can make it click outside of the "real" button/control.... even though this would be against what the help file states under ControlClick:The x position to click within the controlThe y position to click within the controlAlso, be sure and get your x,y values from this part of the Au3Info tool to start with: ControlClick Coords: 665, 107 [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
nxs Posted September 20, 2007 Author Share Posted September 20, 2007 I've not used the x,y parm for ControlClick, but maybe you can use real control info from one of your "real" control/buttons and play with the x,y parm to see if you can make it click outside of the "real" button/control.... even though this would be against what the help file states under ControlClick:The x position to click within the controlThe y position to click within the controlYes, that was the first thing I tried! It won't click another control whatever the coordinates :-( Link to comment Share on other sites More sharing options...
herewasplato Posted September 20, 2007 Share Posted September 20, 2007 You can try the User Defined Function in this old post:http://www.autoitscript.com/forum/index.ph...;showtopic=7112 [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
nxs Posted September 21, 2007 Author Share Posted September 21, 2007 You can try the User Defined Function in this old post:http://www.autoitscript.com/forum/index.ph...;showtopic=7112Now this is the sort of thing I was hoping for!It doesn't do anything for me though I Just pasted the code into a file and added :-Opt("MouseCoordMode", 0)_MouseClickPlus("Document1", "left", 44, 11, 1)I hoped this would click the open file dialog in a new Microsoft Word instance that I had open.Ok maybe Word dosen't like it, maybe..._MouseClickPlus("untitled", "left", 20, 60, 1)click the Free form Select button in Paintnope!It doesn't press the buttons in my problem app either.Am I just unlucky with my tests, or am I missing something do you think?Thanks again tho' Link to comment Share on other sites More sharing options...
herewasplato Posted September 21, 2007 Share Posted September 21, 2007 ...Am I just unlucky with my tests, or am I missing something do you think?...It did not work for me either.I could not test last night.Sorry for the bum steer....fresh out of ideas... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 21, 2007 Moderators Share Posted September 21, 2007 If you are trying to interact with the controls without using MouseClick (or moving the mouse) you could try getting the information with this:http://www.autoitscript.com/forum/index.ph...c=30717&hl=If that doesn't work, you could try the below:http://www.autoitscript.com/forum/index.ph...c=32781&hl=After you see all the control information, just wade yourself through each one seeing if you can find the right button.If that doesn't work, it's slim to none that you'll be able to do it without moving the mouse and using regular mouse click. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
nxs Posted September 25, 2007 Author Share Posted September 25, 2007 If that doesn't work, you could try the below: http://www.autoitscript.com/forum/index.ph...c=32781&hl= After you see all the control information, just wade yourself through each one seeing if you can find the right button. I used the corrected version from later in the post. I didn't understand your example usage, so I hacked it slightly to this :- Global $Array = _WinGetCtrlInfo(WinGetTitle('xxxxxx')) Global $sOne = '' Global $sTwo = '' For $iCC = 0 To $Array[0][0] $sOne &= '[' & $iCC & '][0] = ' & $Array[$iCC][0] & @CR $sTwo &= '[' & $iCC & '][1] = ' & $Array[$iCC][1] & @CR Next MsgBox(64, 'WinInfo', StringTrimRight($sOne, 1) & @CR & StringTrimRight($sTwo, 1)) This reported :- [0][0]=5 [1][0]=ThunderRT6CommandButton1 [2][0]=ThunderRT6CommandButton2 [3][0]=ThunderRT6CommandButton3 [4][0]=ThunderRT6CommandButton4 [5][0]=ThunderRT6Data1 [0][1]= [1][1]=2 [2][1]=3 [3][1]=4 [4][1]=5 [5][1]=1 ( must confess that my ascii art from a previous post was simplified - I really have four 'Normal' buttons that Au3Info can see and four image buttons (two disabled) that Au3Info can't see) The ThunderRT6Data is new to me I also tried the Grabber from Ivan, this yielded :- ---------------------------------------------- Window Name:PRÆMIUM ++++++++++++++++++++++++++++++++++++++++++++++ CtrlId: ThunderRT6CommandButton2 Text: Change &Password CtrlHndl: 0x0118039E CtrlId: ThunderRT6CommandButton3 Text: &Hide CtrlHndl: 0x014D03A6 CtrlId: ThunderRT6CommandButton4 Text: E&xit CtrlHndl: 0x022A02DC CtrlId: ThunderRT6CommandButton1 Text: &Administration CtrlHndl: 0x0145035E ---------------------------------------------- Mmmm, it all seems a bit hopeless at the moment, but it's like an itch that I can't stop scratching Nobody has picked up on the decompiler mention at all .... Link to comment Share on other sites More sharing options...
Bert Posted September 25, 2007 Share Posted September 25, 2007 What you could do is make a VB script to click on the control. Sounds silly, but maybe the code uses a custom control that AutoIt can't see. If it is written in VB, then logic suggest VB should be able to see it. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 25, 2007 Moderators Share Posted September 25, 2007 Nobody has picked up on the decompiler mention at all ....I don't think it's a matter of us "picking" up on it, I know I did. But what you have provided ASCII art or not, simply is not enough.If you want real help, by those that know what they are doing, most won't lift a finger unless they "A" have your script to work and debug on, "B" have the application to work and debug themselves, or in this case "A" and "B" (for me at least).Other than that, we are doing nothing but waisting space with hypothetical guessing. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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