Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialog Box Monitor

Status
Not open for further replies.

JPMorgan

Programmer
Dec 10, 2001
25
US
Has anyone heard of, or written anything that will monitor a computer for a specific dialog box caption and then notify a user via e-mail or other methods?

This would provide a way of e-mailing a cell phone in the middle of the night if a computer presented a specific dialog box on screen.

I have 3 different machines whose sole purpose is to monitor 3 separate lasers using software provided by the Laser Company. Should anything go wrong this third party software notifies the user, much like any other program, through the use of a dialog box.

I thought that someone might know of a product that would detect dialog boxes and then execute an event: e-mail, page, etc.

Anyone know how to capture the caption of a dialog box? And how to differentiate a dialog box from an application's window. I just don't know which direction to go.

Any advice/direction that you can give would be appreciated.
 
You need to gather some data about your target dialog box, namely the class name and the title. You can do it with programs like WinSight or WinSpy.

After having the data, you need a thread periodically analizing the OS active windows tree. The usual way to do it is using an API function called FindWindow and a couple of his siblings.

I believe we have some code in this forum showing how to do it. Or you can google for "FindWindow", I think the 'net is plenty of code examples.

buho (A).
 
Another (much more complicated) approach is to intercept API calls, like MessageBox (and its variants like MessageBoxA, MessageBoxEx, etc) and check the parameters that were passed to each call. When you find a call with the parameter(s) you need, do whatever you want to do.

For a nice tutorial concerning API interception, see
P.S. Unless you do heavy calculation in the interception and parameter checking procedures, the above method has no noticeable overhead ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top