Questions tagged [message-pump]

51 questions
107
votes
6 answers

What is a message pump?

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…
Matt Gutting
  • 1,071
  • 2
  • 8
  • 3
27
votes
8 answers

Pumping Windows Messages During Long Operation?

I'm getting the following message on a big operation that I'm running: The CLR has been unable to transition from COM context 0x1fe458 to COM context 0x1fe5c8 for 60 seconds. The thread that owns the destination context/apartment is most…
sooprise
  • 20,955
  • 62
  • 180
  • 265
27
votes
3 answers

Message pump in .NET Windows service

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,…
Pickles
  • 1,082
  • 2
  • 10
  • 18
20
votes
7 answers

Exceptions silently caught by Windows, how to handle manually?

We're having problems with Windows silently eating exceptions and allowing the application to continue running, when the exception is thrown inside the message pump. For example, we created a test MFC MDI application, and overrode OnDraw: void…
Mark Ingram
  • 65,792
  • 48
  • 164
  • 225
18
votes
3 answers

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

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,…
bavaza
  • 8,590
  • 10
  • 54
  • 88
11
votes
3 answers

How to make a program not show up in Alt-Tab or on the taskbar

I have a program that needs to sit in the background and when a user connects to a RDP session it will do some environment setup then launch a program. When the program is closed it will do some housekeeping and logoff the session. The current way I…
Scott Chamberlain
  • 116,967
  • 28
  • 260
  • 389
10
votes
1 answer

Clean messages in Windows Message Pump

I don't know much about Windows Message Pump but i guess events are triggered using Message Pump. 1) When my Web browser control navigates to some websites it creates different events of Document Completion. Once I have what I need in…
Charlie
  • 4,262
  • 1
  • 28
  • 50
9
votes
2 answers

Message pump in a console application

I have a fairly simple console application written in .NET. Sometimes the application is run in batch mode without an operator, other times it is run "out of pocket". If it's running in batch mode, there is a defined default option which allows the…
JDB still remembers Monica
  • 21,669
  • 4
  • 66
  • 107
8
votes
4 answers

Run multiple UI Threads

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…
Jan Jongboom
  • 24,795
  • 8
  • 74
  • 117
7
votes
3 answers

ShowDialog method hangs without showing the window ¿Deadlock?

We have a WPF busy window indicator. It is shown on the main thread using a window.ShowDialog(). On response to the Loaded event an action is executed and the window is closed so the application continues its work. The window.ShowDialog() seems to…
Ignacio Soler Garcia
  • 20,097
  • 26
  • 114
  • 195
6
votes
3 answers

How to forward messages (eg. mouse wheel) to another Control without stealing focus and without P/Invoke?

I want to forward a message (such as WM_MOUSEWHEEL) when I'm over this control with the mouse, without stealing the focus. This problem can be easily solved intercepting the message with an IMessageFilter (to be added to the application message…
ceztko
  • 13,391
  • 2
  • 44
  • 64
6
votes
1 answer

Python - pythoncom.PumpMessages()

I'm surprised to see that there is not a lot of explained documentation on the function pythoncom.PumpMessages(), or for the pythoncom module. So what does pythoncom.PumpMessages() and pythoncom.PumpWaitingMessages()do and how? All I really know…
user3818650
  • 563
  • 5
  • 18
4
votes
2 answers

How to programmatically exit from a second message loop?

I'm trying to create a second message loop to process/filter low level messages asynchronously in C#. It works by creating a hidden form, exposing it's Handle property to be hooked, and run a second message loop in a separate thread. At the moment…
ceztko
  • 13,391
  • 2
  • 44
  • 64
4
votes
3 answers

Sending a message to the Windows GUI Thread

I've noticed that when you create a web service object (inheriting from SoapHttpClientProtocol) and you use the Async method, it makes the callback on the Windows GUI thread. Does anyone know how this works? How can I achieve the same thing. I…
Richard Nienaber
  • 9,247
  • 5
  • 49
  • 61
4
votes
5 answers

Application.Run not Working after Application.Exit on the same thread

The requirement in my work is to first show a splash screen which takes in a some data from user, authenticates him and starts another form. So, I am starting the splash screen with Application.Run and once, it has done its done, call…
Sheogorath
  • 43
  • 5
1
2 3 4