Jump to content

controlclick help


Recommended Posts

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)

post-41841-12713421758218_thumb.jpg

post-41841-12713421838382_thumb.jpg

post-41841-12713421898723_thumb.jpg

Link to comment
Share on other sites

try something like

$hWnd = WinActivate("CorelDRAW X4 - [Y:\Laser Etching\C2T00058_Serials.cdr] (Print Preview)")
WinWaitActive($hWnd)
ControlClick($hWnd,"","CLASS:AfxControlBar80u;INSTANCE:3])
Edited 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

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 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

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 PDF

Good Luck !

Link to comment
Share on other sites

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

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 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...