locating a captionless modal window with no text

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
chinadrum
Newbie
Posts: 2
Joined: Wed Jan 26, 2005 6:13 pm

locating a captionless modal window with no text

Post by chinadrum » Wed Jan 26, 2005 7:21 pm

I have a really old application which has to export 1 days worth of data at a time, wait for completion and repeat with a new day. It's cake up until the point where i have to check if the current day is done. The status window that comes up is modal, has a blank caption, has no constant text and doesn't always keep focus(due to another app it loads but doesn't close when done). The only thing constant on the window is a progressbar control with the name "Progress1" (msctls_progress32). This rules out doing nice simple methods like FindWindowWithText . I even considered doing a WaitRectChanged over the bottom corner of the box. However, the program is apparently prone to memory errors which would show up over my progress bar. I have also tried WaitReady and WaitCursorChanged, both of which seem to fail because of the other program being loaded at the start of the process. I have also tried to grab the active window handle when the status bar first loads but before the new app opens and it never works out. I can't even get the window to regain focus manually after that point. Is there a way to check if that progress bar object exists and that it is tied to the application i'm monitoring?

Thanks,
Scott

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jan 26, 2005 9:14 pm

There are a number of utilities that can do the same thing.

One that I have liked is PrcView, available at http://www.teamcti.com/pview/prcview.htm that has command lines so you you can use it in scripts and batch files.

You could create a loop to periodically check to see if the process is still active and branch accordingly to results.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Thu Jan 27, 2005 1:12 am

Hi Bob,

Thanks for introducing a useful piece of utility software. What's the difference between PrcView and Process Explorer (from SysInternals)? Thanks again for your help.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Jan 27, 2005 2:11 am

Happy belated Happy New Year, armsys

Been a while since I looked at SysInternals. Maybe I should take a new look? Probably been a few years since I considered it. (Just checked, last time I got an update was Dec, 2003).

As I noted, there are many programs which can monitor and kill a process. I have just been comfortable with PrcView, But you can't have too many good tools in the box. Thank YOU for the reminder about SysInternals.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri Jan 28, 2005 12:23 am

Hi Bob,

Thanks for your kind word. Thanks for your "early" New Year greeting. Chinese New Year of Rooster begins on Feb 9.

I compared the 2 products. Process Explorer appears to be more sophisticated and informative.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts