Listening for dialog box from another program

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?
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
O

Opettaja

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.
 
J

Jan Wagner

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
 
L

Lebesgue

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top