message-pump

Message pump in .NET Windows service

我怕爱的太早我们不能终老 提交于 2019-11-27 06:49:41
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

Which blocking operations cause an STA thread to pump COM messages?

ぃ、小莉子 提交于 2019-11-26 22:39:58
When a COM object is instantiated on an STA thread, the thread usually has to implement a message pump in order to marshal calls to and fro other threads (see here ). One can either pump messages manually, or rely on the fact that some, but not all , thread-blocking operations will automatically pump COM-related messages while waiting. The documentation often doesn't help in deciding which is which (see this related question ). How can I determine if a thread-blocking operation will pump COM messages on an STA? Partial lists so far: Blocking operations which do pump*: Thread.Join WaitHandle

Run multiple UI Threads

隐身守侯 提交于 2019-11-26 22:25:38
Skip to the bottom for the question; this is just some extra info I am using a component (GeckoFX) to render some websites, well fine, yet it can only be used in a Windows Form; as it has to bind to a WinForms object that can be drawn. Because all the WinForms are running in the same thread, I can only use one GeckoFX instance at a time; so I decided to create a 'worker class' in the form of a WinForm, and add all the logic in there. The form doesn't require to communicate with the main form. Now I can fire up 10 windows, and they will eventually work, but every new form will wait before all

Ending a Program Mid-Run

…衆ロ難τιáo~ 提交于 2019-11-26 17:12:23
问题 pythoncom.PumpMessages() From what I understand this line basically tells the program to wait forever. For my purposes it seems to be working. However, I'd like to be able to end the program given the right stimulus. How would one go about ending the above line, or stopping the program from running any further. 回答1: According to these docs, pythoncom.PumpMessages() : Pumps all messages for the current thread until a WM_QUIT message. So one way to stop collecting messages is by posting a WM

Message pump in .NET Windows service

限于喜欢 提交于 2019-11-26 12:12:03
问题 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

Which blocking operations cause an STA thread to pump COM messages?

耗尽温柔 提交于 2019-11-26 09:10:41
问题 When a COM object is instantiated on an STA thread, the thread usually has to implement a message pump in order to marshal calls to and fro other threads (see here). One can either pump messages manually, or rely on the fact that some, but not all , thread-blocking operations will automatically pump COM-related messages while waiting. The documentation often doesn\'t help in deciding which is which (see this related question). How can I determine if a thread-blocking operation will pump COM

Run multiple UI Threads

╄→гoц情女王★ 提交于 2019-11-26 08:21:10
问题 Skip to the bottom for the question; this is just some extra info I am using a component (GeckoFX) to render some websites, well fine, yet it can only be used in a Windows Form; as it has to bind to a WinForms object that can be drawn. Because all the WinForms are running in the same thread, I can only use one GeckoFX instance at a time; so I decided to create a \'worker class\' in the form of a WinForm, and add all the logic in there. The form doesn\'t require to communicate with the main

What is a message pump?

梦想的初衷 提交于 2019-11-26 03:22:57
问题 In this thread (posted about a year ago) there is a discussion of problems that can come with running Word in a non-interactive session. The (quite strong) advice given there is not to do so. In one post it is stated \"The Office APIs all assume you are running Office in an interactive session on a desktop, with a monitor, keyboard and mouse and, most importantly, a message pump.\" I\'m not sure what that is. (I\'ve been programming in C# for only about a year; my other programming experience