Sign in to follow this  
Followers 0
piyanut

How to click OK in MessageBox

12 posts in this topic

#1 ·  Posted (edited)

How to click OK in MessageBox

Snap4.thumb.png.86ad24e0c5754f1b645c34e3

I try to use this code but not working

$title = "Start Load user!!"; the message title
 WinWaitActive("[CLASS:#32770]", "") 

If WinActive("[CLASS:#32770]") Then

    ControlClick("[CLASS:Button; INSTANCE:1]","OK","2","",1)
Else
    
EndIf

 

Edited by piyanut

Share this post


Link to post
Share on other sites



Hello this info

Snap2.png

Share this post


Link to post
Share on other sites

That looks like the info for the window with a start button. Please post the same info when the window is shown you posted first and then have the mouse hover over the OK button.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Here Window info please


 

WinWaitActive("[CLASS:#32770]","Start Load user!!") 

 ControlClick("[CLASS:#32770]","OK","2","",1)

 

that not work how?

Snap3.png

Share this post


Link to post
Share on other sites

How does it go if you don't set the window name in either function call?
What happens if you put a 3 second delay between the winwaitactive and the button click. 

Also, I hear Santa.

Share this post


Link to post
Share on other sites

You are now showing the window information, not the control information of the button. ;)

Jos

I write C# programming my app and show only dialog message that show start and finish message

Share this post


Link to post
Share on other sites

Also, I hear Santa.

You rang?

 

@piyanut

It seems to me you are dealing with two dialog boxes.

In the first, your window text is clearly - Load user finished!!

In the second (with Au3 Info), it is - Start Load user!!

It may be you are mixing up the two?


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

You rang?

 

@piyanut

It seems to me you are dealing with two dialog boxes.

In the first, your window text is clearly - Load user finished!!

In the second (with Au3 Info), it is - Start Load user!!

It may be you are mixing up the two?

Sorry i capture wrong

 

how to used commad

ControlClick("[CLASS:#32770]","OK","2","",1) not work

 

How to fix to auto click button "OK" in Message Box?

Snap4.png

Edited by piyanut

Share this post


Link to post
Share on other sites

Some of your parameters are wrong by the look of it.

ControlClick ( "title", "text", controlID [, button = "left" [, clicks = 1 [, x [, y]]]] )

You need to get the third parameter (controlID) correct if is not '2', and the button (should be left).

ControlClick ("[CLASS:#32770]", "OK", controlID, "left", 1)

 


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

thank you that work ,

 

i am newbie autoit

Snap4.png

Edited by piyanut

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