message-pump

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 figure this will save me having to check for InvokeRequired in my GUI forms if I am sure th...

Trouble with NativeWindow constructed in a thread context

I'm creating a NativeWindow subclass ('MyNativeWindow') in order to use its message pump to communicate with some old DLL. My code runs inside a WinForms application, but I'd like to keep the DLL and it's message processing outside the scope of the GUI. When creating MyNativeWindow from the application context (just before creating my a...

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 the WinForms are running in the same thread, I can only use one GeckoFX instance at a time...

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 you are running Office in an interactive session on a desktop, with a monitor, keyboard and ...

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, this API must be initialized with an HWnd to a windows application because it uses the mes...

"Emulating" Application.Run using Application.DoEvents

I'm getting in trouble. I'm trying to emulate the call Application.Run using Application.DoEvents... this sounds bad, and then I accept also alternative solutions to my question... I have to handle a message pump like Application.Run does, but I need to execute code before and after the message handling. Here is the main significant sni...

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 CTestView::OnDraw(CDC* /*pDC*/) { *(int*)0 = 0; // Crash CTestDoc* pDoc = GetDocument...

Does Speech Recognition using .NET Framework require a message pump?

I'm writing a plugin (dll file), and I'm creating a WinForm as its interface/dialog. If it does require a message pump, how and where should I create one? ...

pumpevents - customized look and feel java taking too much system resources

I make my own GUI see here but system is taking too much resources on further looking into the issue i have found that java pumpevents method is talking too much time. Any resolutions ???? pump events more detail pump event detail ...

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 stuff then launch a program. when the program is closed it will do some housekeeping and logoff the session. The current way I am doing it is like this I have the terminal server launch this application. I have it set as a wind...

Sending and receiving Windows messages

Windows messages seems a good way to notify an application on Windows OSes. It actually works well, but few question comes up to my mind: How to specify structured data to the lparam of the SendMessage routines (like many message codes does)? I mean... of course the parameter is a pointer, but how the process access to it? Maybe is it a...

Why do I get "Object is currently in use elsewhere" exception?

I have a C# WinForms application. This exception is thrown within the static void Main() method when a DevExpress XtraMessageBox is displayed prior to starting up the main UI form. Below is the code (simplified): static void Main(string[] args) { // Display Splash Screen. SplashForm.Start(); if (!CheckLicense()) Xtr...

try/catch all exception in C#

I would like to catch all unhandled exceptions in my UI app in C#, so that I can log them, send them by mail and restart the app. How can I simply get this done? I tried: try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainDlg()); } catch (Exception e) { Logger.Lo...