Bob
Tue Nov 15 05:48:01 CST 2005
You don't "register" windows messages. You can specify any value for the
messsage including a user-defined one that doesn't have some other meaning.
You normally specify the window handle to which the message is to be sent or
you can "broadcast" a message but this isn't a good idea in case other
applications happen to have used the same user-defines messages as you.
I think that the best ways to do what you want would be either through
remoting or to get the window handle of the application you want to
communicate with through the Process class using GetProccesesByName and then
find the window handle for that process and send it a user defined message
directly.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Mircea Pleteriu" <mpleteriu@newsgroup.nospam> wrote in message
news:ezo5LXd6FHA.3588@TK2MSFTNGP15.phx.gbl...
> Hi All,
>
> Here it is what I want to do
> .
> I have a Windows Form application (app1) which at a certain moment sends a
> registered windows message to other Windows Form application (app2) which
> only listen for this window message. When app2 catches the message it
> performs some task and then wait again for the message.
>
> All fine by now. Because the app2 does not expose any interaction with the
> user (the main window of app2 is minimized to sys tray) I'd like to have
> the
> app running as a .NET Windows service.
>
> Is it possible somehow to have a Windows service application listening to
> a
> registered window message?
>
> Thanks,
> Mircea
>
>