Jump to content

controlclick problem


Recommended Posts

He is my script

1-Shellexecute("watchhdtvplay", "", "c:\documents and settings\desktop")

2-Sleep(10)

3-Controlclick("watchhdtvplay", "", "[class:button; text:open; instance:2]")

He is my info from Info Tool

Basic Window Info

Title-Watchhdtvplay

Class-#32770

Basic Control Info

Class-Button

Instance-2

Control Tab from Info Tool

Class-Button

Instance-2

Classnamenn-Button2

Advanced(Class)-Class:Button; Instance:2

ID-1000

Text-Open

Pos-354,29

Size-54,20

Controlclick Coords-29,14

Style-0x0018000

Exstyle-0x00000004

Handle-0x00302ee

The script will run to command 2 and stop. The window that opens is active. Steps 1 and 2 act as anticipated. The purpose of the controlclick function is to click on the "open" button and activate it. Can anyone see where I'm going wrong.

Thanks

Edited by jdefed
Link to comment
Share on other sites

<rant>Please use code tags, they are your friends :idea:

They make reading much easier, and the autoit tags will link keywords directly to the documentation. It just makes everyone's lives easier.

Shellexecute("watchhdtvplay", "", "c:\documents and settings\desktop")
Sleep(10)
Controlclick("watchhdtvplay", "", "[class:button; text:open; instance:2]")

He is my info from Info Tool

Basic Window Info
Title-Watchhdtvplay
Class-#32770 

Basic Control Info
Class-Button
Instance-2

Control Tab from Info Tool
Class-Button
Instance-2
Classnamenn-Button2
Advanced(Class)-Class:Button; Instance:2
ID-1000
Text-Open
Pos-354,29
Size-54,20
Controlclick Coords-29,14
Style-0x0018000
Exstyle-0x00000004
Handle-0x00302ee
</rant>

It's possible that the documentation is just a bit more of a stickler for details, but you might be having a problem because of improper capitalization. Try this:

Shellexecute("watchhdtvplay", "", "c:\documents and settings\desktop")
WinWaitActive ('Watchhdtvplay'); Just demonstrating a different way of doing it, possibly faster, definitely more reliable
Controlclick("Watchhdtvplay", "", "[class:Button; text:Open; instance:2"); capitalized to match output from Info Tool

It might seem like cheating a little, but you can often just copy and paste the bit from the 'Advanced(Class)' line and be done with it (no typing - yay!).

Edited by Fulano

#fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!

Link to comment
Share on other sites

Two things:

1. 10 milliseconds is not long enough to wait before trying to interact with a new GUI. Use WinWait() to wait until it comes up before trying to use it.

2. Window title matches are case sensitive: "watchhdtvplay" <> "Watchhdtvplay"

:idea:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...