On Mar 1, 8:04 pm, Angel Caban <vega.pr...@comcast.netwrote:
andre...@gmail.com wrote:
I'm developing a windowsservicethat needs to listen for a particular
WM_ message. Is there a way to listen for a message from .NETservice
application?
This would seem to be a simple thing, but I haven't seen anything on
it...
I think these are what you're looking for:http://msdn2.microsoft.com/en-us/lib....forms.message...
Yes, thank you, that was it!
Unfortunately I can't get it to work. I created a NativeWindow and
overrode its WndProc. It works great when started with
Application.Run(), but no messages are received when started as a
Service.
Interact with the Desktop is checked.
The window handle is created in the Service.
The call to RegisterHotkey is successful.
But no messages.
As a test I stuck an Application.Run() in the OnStart. Suddenly
messages are received. (it hangs the service of course)
So what's the difference between ServiceBase.Run and Application.Run
in how windows messages are received? It looks like ServiceBase.Run
isn't forwarding the messages to my NativeWindow.
Ideas?