469,902 Members | 1,910 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,902 developers. It's quick & easy.

detect and close a modal dailog in c#

Hi, I would like to write a c# application. to detect if a modal dialog opens
on another application, (e.g. notepad.exe save changes dialog when you click
exit ) and auto cancel it. How do I detect the modal dialog opening?

Thanks for your help
Leni
Feb 21 '08 #1
2 3633
Hi Leni

First you have to know the name of the application you want to "control"
second the window name on which you want to click.
There is a Program called "spy.exe" for that. After you "know" your window
is open i would deal with sendkeys.

btw. There is a freeware application to do such things -AutoIT if you 've
not the time to reinvent the weel.

Cheers Marcel
Hi, I would like to write a c# application. to detect if a modal
dialog opens on another application, (e.g. notepad.exe save changes
dialog when you click exit ) and auto cancel it. How do I detect the
modal dialog opening?

Thanks for your help
Leni

Feb 21 '08 #2
Thanks Marcel, I'll have a look at that.

Leni

"Härry Marcel" wrote:
Hi Leni

First you have to know the name of the application you want to "control"
second the window name on which you want to click.
There is a Program called "spy.exe" for that. After you "know" your window
is open i would deal with sendkeys.

btw. There is a freeware application to do such things -AutoIT if you 've
not the time to reinvent the weel.

Cheers Marcel
Hi, I would like to write a c# application. to detect if a modal
dialog opens on another application, (e.g. notepad.exe save changes
dialog when you click exit ) and auto cancel it. How do I detect the
modal dialog opening?

Thanks for your help
Leni


Feb 22 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Bill Belliveau | last post: by
2 posts views Thread by anil kumar via .NET 247 | last post: by
1 post views Thread by Jeremy | last post: by
6 posts views Thread by Steve | last post: by
21 posts views Thread by Bob Darlington | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.