473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to receive Operating System messages?

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

Thank

Dinoo
Jul 21 '05 #1
1 1397
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Robert Rossney | last post by:
I'm trying to send and receive XmlDocument objects using the System.Messaging.dll functions. The code I've written follows, as best I can tell, the methodology used in the sample code for the...
4
by: Morten Overgaard | last post by:
Hi I'm listening on the SysLog port (514) through UDP. The problem is that I am not receiving anything nut I know that i get messages on the port. When I use KIWI to listen on the same port via...
2
by: Richard A. Wells | last post by:
All I wanted to do was implement a web service where I'd receive an XML document and return one in response. I'd already figured out how to use XmlReader and XmlWriter classes to do the XML work I...
1
by: Dan Kelley | last post by:
I have 2 projects - 1 Winform project that sends Udp messages using the UdpClient class when a button is clicked, and a Console application that listens for these Udp messages. If I try to use...
1
by: Steve | last post by:
Please take a look at the simple code segment below and advise me what is wrong. According to the help and examples I've seen it should work unless I misunderstand something. The problem is...
1
by: Saso Zagoranski | last post by:
Hi! I have simple client/server game that uses sockets to transfer different messages. The server and the client are running on the same machine.
1
by: dinoo | last post by:
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...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
3
by: Joe Blauth | last post by:
Hi all, I am currently working on a small application that sends messages from a client to a server and receives messages in return. Basically the functionality is made with sockets which is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.