Jump to content
Sign in to follow this  
Otacon

Click in GUI while in Background?

Recommended Posts

Otacon

Hello everybody.

Is there a way to click somewhere in a AutoIt gui with having the GUI minimized?

I guess its easier to understand what i want if i show you my code.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <String.au3>
_IEErrorHandlerRegister()
$IE = _IECreateEmbedded()
GUICreate("Testgui", 1100, 600)
$Browser = GUICtrlCreateObj($IE, 10, 10, 1080, 550)
Opt("MouseCoordMode", 2)
GUISetState()
_IENavigate($IE, "www.somesite.com")
Sleep (10000)
MouseClick ("primary",1004,398)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
GUIDelete()
Exit

I wanna start this script, and then minimize the GUI.

I want this to completely run in the Background without having focus.

Anybody can point me in the right direction?

Also another question, maybe i don't need to create another topic for that one.

How can i wait till the title of the Webpage loaded in the IE Object changes? (its done with Javascript after a certain time has passed)

Edited by Otacon

Share this post


Link to post
Share on other sites
AutoBert

Try ControlClick

Share this post


Link to post
Share on other sites
Otacon

Thanks, that should be what i needed. But i somehow cant get it to work.

Or at least it doesn't seem to press the button i want it to press.

#include
#include
#include
#include



_IEErrorHandlerRegister()
$IE = _IECreateEmbedded()
GUICreate("Testgui", 1100, 600)
$Browser = GUICtrlCreateObj($IE, 5, 10, 1080, 550)
$Button_1 = GUICtrlCreateButton("Run", 990, 570, 100)
Opt("MouseCoordMode", 2)

GUISetState()

_IENavigate($IE, "www.google.de")

While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
ControlClick ( "Testgui", "", "","primary" ,1 , 398, 1005 )
Sleep(2000)
MsgBox ( "", "Yes","Yeah i just pressed that")
EndSelect
WEnd

GUIDelete()

Exit

Ok Solved it myself after some trial and error.

ontrolClick ( "[Class:AutoIt v3 GUI]", "", "[ClassNN:Internet Explorer_Server1]","primary" ,1 , 398, 300 )
Edited by Otacon

Share this post


Link to post
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
Sign in to follow this  

×