Message pump in C# Windows service
Posted
by Pickles
on Stack Overflow
See other posts from Stack Overflow
or by Pickles
Published on 2010-03-14T21:33:37Z
Indexed on
2010/03/14
21:35 UTC
Read the original article
Hit count: 1012
Hello,
I have a Windows Service written in C# that handles all of our external hardware I/O for a kiosk application. One of our new devices is a USB device that comes with an API in a native DLL. I have a proper P/Invoke wrapper class created. However, this API must be initialized with an HWnd to a windows application because it uses the message pump to raise asynchronous events.
Besides putting in a request to the hardware manufacturer to provide us with an API that does not depend on a Windows message pump, is there any way to manually instantiate a message pump in a new thread in my Windows Service that I can pass into this API? Do I actually have to create a full Application class, or is there a lower level .NET class that encapsulates a message pump?
Thanks
© Stack Overflow or respective owner