Solved

automatically click OK to close a dialog box

Posted on 2009-07-02
4
1,483 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Introduction to Processes

691 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