Listening for dialog box from another program

  • Thread starter Thread starter Opettaja
  • Start date Start date
O

Opettaja

I am trying to make a program that times how long it takes to do
something in another program. Is there away to make my timer program
listen for a dialog box to open on the other program and then perform
some functions in my timer program? I do not have the source code for
the program I am trying to listen to. Does anyone know how/if I can do
this?
 
Opettaja,

It will be VERY difficult to do this. Unless it has an interface of
some sort (as in remoting, automation, or something) to control it, you will
have to resort to sending messages to the app and then trying to hook into
the results, which is not a small proposition at all.
 
lol okay, well its not worth it, its just a stop watch thats timing how
long it takes to save and load from database with a program from work.
I will just manually click the start and stop button I guess.
 
Opettaja kirjoitti:
I am trying to make a program that times how long it takes to do
something in another program. Is there away to make my timer program
listen for a dialog box to open on the other program and then perform
some functions in my timer program? I do not have the source code for
the program I am trying to listen to. Does anyone know how/if I can do
this?

You could try something like Win32 API FindWindow or FindWindowEx and
periodically check if the dialog/window can still be found (by those
funcs). Something remotely like
http://www.codeproject.com/csharp/cskillapp.asp

No idea how well it would work for your purposes, though :)

- Jan
 
You can use a profiler to do performance analysis of managed code - very
good one in my opinion is ANTS Profiler
 
Back
Top