Jump to content

Recommended Posts

Posted

Hi,

I am a beginner in Auto IT.

I need to click a link in GUI window.

Can anyone guide me with the functions needed to click a link in GUI.

Thanks!

Posted

Welcome!

Example:

#include <GuiConstants.au3>

Global $Flag = 1

$hGui = GUICreate(":-)", 240, 120)

$URL_Label = GUICtrlCreateLabel("Welcome to AutoIT forum", 60, 40, 130, 16)
GUICtrlSetCursor(-1, 0)
;GUICtrlSetBkColor(-1, 0xFF0000)

GUISetState()

While 1
    $msg = GUIGetMsg()
    
    Switch $msg
    Case $GUI_EVENT_CLOSE
        ExitLoop
    Case $GUI_EVENT_MOUSEMOVE
        $aCurPos = GUIGetCursorInfo()
        
        If $aCurPos[4] = $URL_Label And $Flag = 1 Then
            GUICtrlSetColor($URL_Label, 0xFF0000)
            GUICtrlSetFont($URL_Label, Default, Default, 2)
            $Flag = 0
        ElseIf $aCurPos[4] <> $URL_Label And $Flag = 0 Then
            GUICtrlSetColor($URL_Label, 0x000000)
            GUICtrlSetFont($URL_Label, Default)
            $Flag = 1
        EndIf
    Case $URL_Label
        ShellExecute("http://www.autoitscript.com/forum")
    EndSwitch
WEnd
:)
Posted

I need to click a link in GUI window.

Not really sure but I think he wanted to know how to click on a link, not create a GUI with a link.

@Sajesh...is it a IE window that has the link?...If so look in the helpfile for IE functions.

Posted

Not really sure but I think he wanted to know how to click on a link, not create a GUI with a link.

@Sajesh...is it a IE window that has the link?...If so look in the helpfile for IE functions.

Sorry for not explaining my question well.

Actually I am testing a window that has a link.

My objective is to click that link in the GUI window without using mouse and I dont have the URL of that link.

How can I recognize that link in the window and click it with the keyboard.

Please explain.

Posted

@Sajesh..You can try getting the control name of the link by using the Autoit Window Spy ("C:\Program Files\AutoIt3\Au3Info.exe").

But spy is not recognizing the link. Is there any other way?
Posted

Welcome!

Example:

#include <GuiConstants.au3>

Global $Flag = 1

$hGui = GUICreate(":-)", 240, 120)

$URL_Label = GUICtrlCreateLabel("Welcome to AutoIT forum", 60, 40, 130, 16)
GUICtrlSetCursor(-1, 0)
;GUICtrlSetBkColor(-1, 0xFF0000)

GUISetState()

While 1
    $msg = GUIGetMsg()
    
    Switch $msg
    Case $GUI_EVENT_CLOSE
        ExitLoop
    Case $GUI_EVENT_MOUSEMOVE
        $aCurPos = GUIGetCursorInfo()
        
        If $aCurPos[4] = $URL_Label And $Flag = 1 Then
            GUICtrlSetColor($URL_Label, 0xFF0000)
            GUICtrlSetFont($URL_Label, Default, Default, 2)
            $Flag = 0
        ElseIf $aCurPos[4] <> $URL_Label And $Flag = 0 Then
            GUICtrlSetColor($URL_Label, 0x000000)
            GUICtrlSetFont($URL_Label, Default)
            $Flag = 1
        EndIf
    Case $URL_Label
        ShellExecute("http://www.autoitscript.com/forum")
    EndSwitch
WEnd
:)
Thanks Rasim! I gained a lot of knowledge from ur code.
  • Moderators
Posted

But spy is not recognizing the link. Is there any other way?

Can we have the app name... maybe someone can show you easily rather than guessing what it would be.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Can we have the app name... maybe someone can show you easily rather than guessing what it would be.

It is an XML based application.
Posted

Can we have the app name... maybe someone can show you easily rather than guessing what it would be.

It is an XML based application.
Posted

It is an XML based application.

Please consider this example:

Open IE 7

Click Help--> About.

In the about window there is a link '2006 Microsoft Corporation'.

Auto IT spy is not recognizing this link.

  • 1 month later...

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
  • Recently Browsing   0 members

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