rocksolidsr Posted April 15, 2010 Share Posted April 15, 2010 I'm trying to get controlclick to work but there seems to be three different control boxes over what I'm trying to click and I can't seem to figure it out. I've attached 3 pictures of the area I'm trying to click and below is my code WinActivate("CorelDRAW X4 - [Y:\Laser Etching\C2T00058_Serials.cdr] (Print Preview)") WinWaitActive("CorelDRAW X4 - [Y:\Laser Etching\C2T00058_Serials.cdr] (Print Preview)") ControlClick("CorelDRAW X4 - [Y:\Laser Etching\C2T00058_Serials.cdr] (Print Preview)","",59420,"left",1,19,95) Link to comment Share on other sites More sharing options...
JohnOne Posted April 15, 2010 Share Posted April 15, 2010 (edited) try something like $hWnd = WinActivate("CorelDRAW X4 - [Y:\Laser Etching\C2T00058_Serials.cdr] (Print Preview)") WinWaitActive($hWnd) ControlClick($hWnd,"","CLASS:AfxControlBar80u;INSTANCE:3]) Edited April 15, 2010 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...
rocksolidsr Posted April 15, 2010 Author Share Posted April 15, 2010 i tried that and it didn't do anything, is there anymore information that i can give that would help me get this working. Link to comment Share on other sites More sharing options...
JohnOne Posted April 15, 2010 Share Posted April 15, 2010 I cant figure from the picture what it is you are trying to click. Does the window get activated ? 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...
rocksolidsr Posted April 15, 2010 Author Share Posted April 15, 2010 yeah the window gets activated but it doesn't seem to click anywhere attached is a picture of what i want to click on (in the red box) Link to comment Share on other sites More sharing options...
JohnOne Posted April 15, 2010 Share Posted April 15, 2010 (edited) Tryit with the coords $hWnd = WinActivate("CorelDRAW X4 - [Y:\Laser Etching\C2T00058_Serials.cdr] (Print Preview)") WinWaitActive($hWnd) ControlClick($hWnd,"","[CLASS:AfxControlBar80u;INSTANCE:3]","Primary",1,17,165) Edited April 15, 2010 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...
rocksolidsr Posted April 15, 2010 Author Share Posted April 15, 2010 I had to use [CLASS:Afx:62500000:8:00010011:00000010:00000000; INSTANCE:6] instead of CLASS:AfxControlBar80u;INSTANCE:3] do you think that, that will change if it is on another computer? Link to comment Share on other sites More sharing options...
l3ill Posted April 15, 2010 Share Posted April 15, 2010 Hi, this is just a suggestion...have you had a look at the command line possibilities to print with CD? they are probably going to be more dependable than trying to code this situation cross platform.network admin guide for CD PDFGood Luck ! My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
JohnOne Posted April 16, 2010 Share Posted April 16, 2010 I had to use [CLASS:Afx:62500000:8:00010011:00000010:00000000; INSTANCE:6] instead of CLASS:AfxControlBar80u;INSTANCE:3] do you think that, that will change if it is on another computer? I wish I could tell you mate, but I dont have that know how. If you dont have access to another computer where you are, you are best testing it somewhere else aswell. My guess is yes, it will be the same, but Im pretty much a noob and my advice is less than solid, so my guesses can be rounded down to hit or miss. In short, just test it out. Also, if the ID is always the same then maybe you should try that, but in brackets "[59420]" or "[iD:59420]". Just try everything you can possibly think of mate, two things are for sure, your computer will not blow up and you will advance in your learning. Good luck. 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...
bo8ster Posted April 16, 2010 Share Posted April 16, 2010 (edited) I wish I could tell you mate, but I dont have that know how. If you dont have access to another computer where you are, you are best testing it somewhere else aswell. My guess is yes, it will be the same, but Im pretty much a noob and my advice is less than solid, so my guesses can be rounded down to hit or miss. In short, just test it out. Also, if the ID is always the same then maybe you should try that, but in brackets "[59420]" or "[iD:59420]". Just try everything you can possibly think of mate, two things are for sure, your computer will not blow up and you will advance in your learning. Good luck. To be clear, class name is always the same. The instance can it is just a count of the number of classes of the same name. It should be the same all the time if the program is used in the same way. Control IDs are nearly always the same, in most cases they will be static. I have seen them be dynamicly created upon execution. Either they change a lot or they don't change at all. Give yourself some credit John ur not a noob. To expand on Johns code Global Const $hWnd = WinActivate("CorelDRAW X4 - [Y:\Laser Etching\C2T00058_Serials.cdr] (Print Preview)") WinWaitActive($hWnd) $hControl = ControlGetHandle($hWnd, "", "[CLASS:AfxControlBar80u; INSTANCE:3, ID:59420]") ;also try $hControl = ControlGetHandle($hWnd, "", "[CLASS:AfxControlBar80u; TEXT:Toolbox") $hControl = ControlGetHandle($hWnd, "", "[CLASS:AfxControlBar80u; INSTANCE:3") $hControl = ControlGetHandle($hWnd, "", "[CLASS:AfxControlBar80u; ID:59420]") ConsoleWrite($hControl & @CR) ; compare against the info tool. ControlClick($hWnd,"",$hControl) ; since you have the control handle coords are not required. Edited April 16, 2010 by bo8ster Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] 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