Jump to content

Determine if IE Button is Pressed/Clicked


Recommended Posts

Hello guys,

I am trying to create autoit codes in order to determine if IE button was clicked or pressed.

I am not sure if it is possible for IE button.

Here is my initial code.

#include <IE.au3>
#include <MsgBoxConstantsau
#include <WinAPI.au3>


AutoIt

$searchTab = "Untitled 1 - Internet Explorer"

WinActivate("Untitled 1 - Internet Explorer")
Local $oIE = _IEAttach("", "instance", 1)
For $i = 0 To 100
Send("^" & $i)
Sleep(250)

If Not(StringInStr(WinGetTitle("[ACTIVATE]", $searchTab) = 0) Then


While 1
If $oGetItem = 1 Then
MsgBox($MB_SYSTEMMODAL, "Attention!", "It's working!")
EndIf
WEnd
ExitLoop


EndIf

Next

 

Link to comment
Share on other sites

A few comments --

For $i = 0 To 100
Send("^" & $i)

I doubt that this will actually work. Isn't the Control+Number functionality limited to the first nine tabs?

WinGetTitle("[ACTIVATE]"

To get the window title of the browser, do this:

$hwnd = _IEPropertyGet($oIE, "hwnd")
$title = WinGetTitle($hwnd)

Beyond that, it isn't clear to me what you are trying to do with this script. ;-)

Link to comment
Share on other sites

8 hours ago, Danp2 said:

A few comments --

For $i = 0 To 100
Send("^" & $i)

I doubt that this will actually work. Isn't the Control+Number functionality limited to the first nine tabs?

WinGetTitle("[ACTIVATE]"

To get the window title of the browser, do this:

$hwnd = _IEPropertyGet($oIE, "hwnd")
$title = WinGetTitle($hwnd)

Beyond that, it isn't clear to me what you are trying to do with this script. ;-)

Hello @Danp2,

The 1st part codes of line are already working.

From While 1 code, I'm trying to create a code were it could determine if the $oGetItem was clicked or pressed. If so, it will start to track the time. Is it possible to determine or detect if an IE button was clicked/pressed?

 

Thanks Danp2! 👍

Link to comment
Share on other sites

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

×
×
  • Create New...