473,325 Members | 2,442 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,325 software developers and data experts.

Listening to windows messages from a windows service

I'm developing a windows service that needs to listen for a particular
WM_ message. Is there a way to listen for a message from .NET service
application?

This would seem to be a simple thing, but I haven't seen anything on
it...

Mar 1 '07 #1
2 9040
an******@gmail.com wrote:
I'm developing a windows service that needs to listen for a particular
WM_ message. Is there a way to listen for a message from .NET service
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...agefilter.aspx
http://msdn2.microsoft.com/en-us/lib...s.message.aspx

Mar 2 '07 #2
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?

Mar 2 '07 #3

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

Similar topics

3
by: ssantamariagarcia | last post by:
I am trying to program a server in C for UNIX to get a kind of "bridge" between the clients of a port A and the clients of a port B. For that, I create 2 processes: one that listen the requests of...
5
by: Adam | last post by:
Hi, How do i listen for windows messages in c# on compact.net? I have a window containing an instantiation of the HTML viewer control, which is a child of the main form. As the compact...
1
by: Artur Kowalski | last post by:
I have a NotifyIcon in my Windows Service project and I am trying to add a ContextMenu to this NotifyIcon or use some of the mouse events. Everything isn't working. I think so base class of the...
14
by: Brian Keating EI9FXB | last post by:
I wonder can anyone reccomment a solution to this problem. Let me explain, I've services running on my system, my application receives diagnostic messages from these services, what i want to do...
3
by: Nathan Kovac | last post by:
I have a feeling I am missing something simple, but I just can't find it. Perhaps someone can give me a lead on where to look. I will describe the issue then post my code to the web service. My...
1
by: benmorganpowell | last post by:
I have a small windows service which connects to a POP3 server at defined intervals, scans the available messages, extracts the required information and inserts the data into a SQL database. I am...
5
by: Eric | last post by:
Hi I built a service that watch file in a directory. I use a simple filewatcher and add a handler to do something when a file is created. I have the following problem. I can build it, I can...
0
by: Charles Leonard | last post by:
I am having yet another issue with Windows Server 2003. This time, the web service (a file import web service) appears to run except for one odd message: "ActiveX component can't create object". ...
5
by: eliasen | last post by:
Hi I have created a Windows Service using C# and .NET2.0. The service is quite simple - right now it doesn't do anything except throwing an exception in the OnStart method. It used to something...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.