Short of starting Word yourself and interacting with it through automation,
no. In order to know when a "window" closes you'd have to hook the process
and you can't do that from C#.
You can use the System.Diagnostics.Process class to "attach" to the Word
process and subscribe to the Exited event to know when the process exits,
but this is all or nothing - you won't be notified when other things (like
new documents being opened) happen.
The OS does not provide this sort of thing, at least not in a way that is
useable from a managed application.
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"dinoo" <an*******@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
I am looking this for a long time now.
I have a Windows Form in C#? I opened another window (of other
application) or MS Word Document. If user closes the document and other window is there some way to trap
this event using windows API. How do C# Form comes to know that the document or other window is closed?
Is there any way to receive that message from Operating Systems?
Some help would be appreciated.
Thanks
Dinoo