Solved

automatically click OK to close a dialog box

Posted on 2009-07-02
4
1,469 Views
Last Modified: 2013-11-10
Hi
I've got a program, which show me dialog box with a message and OK button to close it. I have to click on it nearly thousand times, which is impossible. Unfortunately this is very specific program, it's in beta now, but I have to use it. Developers were notified, but it may take a lot of time till I get a new version.
So as a temporary workaround may be I can find a small (better free) utility to automatically click OK and close this dialog once it appears. It should not affect my other work on the computer. Can anybody help?
I'm working under Windows XP Pro SP2.
Thanks
0
Comment
Question by:yuk99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:iUsername
ID: 24765576
use FindWindow() function to find the window, and than send the message WM_CLOSE to the window.

If you MUST click on the OK button, you can use GetWindow() to get to the next child window (probably the button OK, or keep on going until you find that button, and send to it WM_CLICK.

You can use AutoIt 3 to write such a script real fast and easy.
0
 
LVL 15

Author Comment

by:yuk99
ID: 24765734
I'm not going to develop this program myself. AutoIt3 may be a good solution. Will study. Can you help me with a script? To wait for a window with exact title and click OK.
0
 
LVL 5

Accepted Solution

by:
iUsername earned 500 total points
ID: 24766315
Try the following autoit code.
you need to enter the dialog box title, and you can enter another parameters to WinWaitActive() that contains the text in the dialog box.

While True
	
	; wait for the dialog box window
	WinWaitActive("dialog box title here")
	Send("{ENTER}")
	
WEnd

Open in new window

0
 
LVL 15

Author Closing Comment

by:yuk99
ID: 31599330
Thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Output in PHP throwing alignment of data off issue 12 57
Selenium docs api java index 3 69
asp Google Map 2 64
Hide file extensions in Notepad++ tabs 2 55
A short article about problems I had with the new location API and permissions in Marshmallow
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question