Jump to content

ControlClick(Hidden) works in Opera&FFox, but not IE


Recommended Posts

Good morning togehter.

Studying controlclick the whole night, and managed to get it to work in Opera and FFox while the Window is hidden/minimized.

This works in Opera e.g.:

Autoit INFO:

______________________________________________________________________

>>>> Window <<<<

Title: AutoIt Script Home Page - Mozilla Firefox

Class: MozillaUIWindowClass

Position: -9, 80

Size: 1026, 811

Style: 0x14CF0000

ExStyle: 0x00000100

Handle: 0x008D03D8

>>>> Control <<<<

Class: MozillaWindowClass

Instance: 5

ClassnameNN: MozillaWindowClass5

Advanced (Class): [CLASS:MozillaWindowClass; INSTANCE:5]

ID:

Text:

Position: 0, 114

Size: 1001, 641

ControlClick Coords: 634, 120

Style: 0x56000000

ExStyle: 0x00000000

Handle: 0x02D40546

___________________________________________________________________

Opt("MouseCoordMode", 2)
Opt("WinTitleMatchMode", 4)

$hWnd = WinGetHandle("AutoIt Script Home Page - Mozilla Firefox")

;WinWait($hWnd)
;If Not WinActive($hWnd) Then WinActivate($hWnd)
;WinWaitActive($hWnd)

; WINDOW IS NOT ACTIVE!!

sleep(1000)
ControlClick($hWnd, "", "MozillaWindowClass5", "left", 1, 634, 120) ;;;;Opens The forum

; Works Fine!!

++++++++But now IE:++++++++++

Autoit INFO:

________________________________________________

>>>> Window <<<<

Title: AutoIt Script Home Page - Windows Internet Explorer

Class: IEFrame

Position: 29, 29

Size: 1218, 879

Style: 0x14CF0000

ExStyle: 0x00000100

Handle: 0x00C00222

>>>> Control <<<<

Class: Internet Explorer_Server

Instance: 1

ClassnameNN: Internet Explorer_Server1

Advanced (Class): [CLASS:Internet Explorer_Server; INSTANCE:1]

ID:

Text:

Position: 0, 93

Size: 1210, 729

ControlClick Coords: 722, 125

Style: 0x56000000

ExStyle: 0x00000000

Handle: 0x02510520

______________________________________________

Opt("MouseCoordMode", 2)
Opt("WinTitleMatchMode", 4)

$hWnd = WinGetHandle("AutoIt Script Home Page - Windows Internet Explorer")

;WinWait($hWnd)
;If Not WinActive($hWnd) Then WinActivate($hWnd)
;WinWaitActive($hWnd)

; WINDOW IS NOT ACTIVE!!

sleep(1000)
ControlClick($hWnd, "", "Internet Explorer_Server1", "left", 1, 722, 125) ;;;;Opens The forum

; Does not Work when NOT active!!

;even statusbar only works when active

$status=StatusbarGetText($hWnd)
ConsoleWrite($status&@LF)

ONLY WORKS WHEN ACTIVE!!!

even statusbar only works when active.

Is there no REAL controlID??

I dont get it.

thx in advance.

Edited by Leonick
Link to comment
Share on other sites

From the help file under Controls:

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

I would say the you have experimented :-)

You might try the _IE UDF functions.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Hmmm...the thing is it doesnt work with ANY Internetsite....weather Html or javascript.

So the error must be somewhere else,...since its working,...but not Hidden.

as i said: Opera and FFox..no problems.

Link to comment
Share on other sites

Hmmm...the thing is it doesnt work with ANY Internetsite....weather Html or javascript.

So the error must be somewhere else,...since its working,...but not Hidden.

as i said: Opera and FFox..no problems.

Some "controls" have to be in focus (not hidden) to work. This is true for app other than IE - so you have found out that your cannot do what you want to IE when the window is not in focus. You might have to use the _IE UDF functions.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Damn.... "Some" are not working?? tried so many sites....hmm ok.

And in the helpfile it said:

"...StatusbarGetText can work on windows that are minimized or even hidden."

But ITS never working!!

Their must be a mistake in my script.

I can use Opera-Firefox on hidden windows perfectly, but i cannot read use the statusbar with (pixelgetcolor)!!

And i cannot use IE, which has a really nice integrated statusbarfunction, but is not working hidden!?!

And sorry, the other IE_Udf functions i dont get in my mind....

They seem not as easy as using mousecoords.

:-(

Link to comment
Share on other sites

They may seem harder but they are worth learning if you are going to automate webpages.

I would have a look at what ControlClick returns too.

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

This works for me...

AutoItSetOption("WinTitleMatchMode", 2)
$x = StatusbarGetText("Internet Explorer")
MsgBox(0, "Internet Explorer's status bar says:", $x)
If the link of interest shows in the status bar - then maybe:

Do
    Send("{tab}")
    Sleep(99)
Until WinExists("Internet Explorer", "text")

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

This works for me...

AutoItSetOption("WinTitleMatchMode", 2)
$x = StatusbarGetText("Internet Explorer")
MsgBox(0, "Internet Explorer's status bar says:", $x)
If the link of interest shows in the status bar - then maybe:

Do
    Send("{tab}")
    Sleep(99)
Until WinExists("Internet Explorer", "text")

the first solution is np on active windows,as i used in my script.

But i wanna do it on hidden windows!!

so the second option is no solution either.

Does anyone have an example on Controlclick, which is working on hidden Windows in IE??

Link to comment
Share on other sites

Hey boys and girls.

I asked 3 times,...where the error in my script was.

And all you were saying, that i should make it more complicated with the _IE UDF functions,...while controlclick() can be so easy!!

I was right!

There was an error in my script:

#include <IE.au3> ; IS NEEDED to work.

None of you realized that?

I mean simple script and simple solution!

thx anyway

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