Sign in to follow this  
Followers 0
trademaid

winactive problem

8 posts in this topic

#1 ·  Posted (edited)

winactiveate wont put the cursor into the section that says login.

Its interment.

Sometimes its on browse (see png) and sometimes its on Username

Opt("WinTitleMatchMode", 1)     ;1=start, 2=subStr (any), 3=exact, 4=advanced, -1 to -4=Nocase
$ret=WinActivate("Login","") ; ret =  ->0x001101C8
WinWaitActive("Login","")
$active=WinGetTitle("Login")
ConsoleWrite("active " & $login & " ->" & $active & @crlf)

sleep(3000)
$ret=WinActivate("Login","") ; ret =  ->0x001101C8
ConsoleWrite("send uname=" & $login & " ->" & $ret & @crlf)
sleep(3000)
Send("username{tab}")

post-34520-12717486871455_thumb.png

Edited by trademaid

Share this post


Link to post
Share on other sites



Winactivate only make that window active not a certain control in the window, to give a control 'focus' use ControlFocus.


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites

can you please explain more some?

Im not clear how it works

ie

Conrolfocus("login","",User name")

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It is possibly, and may work.

Controlfocus("Login", "", "Edit1")

The "Edit1" is a guess but AutoIt Info Tool will tell you what the classnameNN is so use it to check.

Edit:

And your picture says that "login" is actually "Login". Titles and text is case sensitive. Corrected code to reflect this.

Edited by MHz

Share this post


Link to post
Share on other sites

The class field under basic control window is blank.

What do i do in this case?

post-34520-12717997685204_thumb.png

Share this post


Link to post
Share on other sites

Thanks for the picture. I googled "sunawtframe" and come up with this AutoIt topic here. Review the topic as it may have some value for you. So it looks like the window is a Java based application. AutoIt is C runtime based so Java is alien for AutoIt to recognize.

If you do not what to use a 3rd party Dll as the linked topic talks about, then you maybe able to use ControlClick() and use the whole window as a control such that you use the coordinates of ControlClick() to click on the desired control. Then there is MouseClick() which can work within the window coordinates. Or perhaps Send() using TABs which is perhaps blind as the application is not always starting with consistent focus of a control as you mentioned.

Share this post


Link to post
Share on other sites

I had no success with controll focus, but did get control move to work.

How to I figure out the coordinates of the field by username. ( i tried many guess's)

C

ControlClick("Login","","","left", 1, 112,111) doesnt seemt work,

It returns 1

Share this post


Link to post
Share on other sites

problem fixed

used mouseclick command after ControlMove("Login","","",00,00)

thanks all for your help.

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  
Followers 0