Questions tagged [message-pump]

53 questions
4
votes
3 answers

Visual Basic.NET: how to create a thread to update the UI

The usual VB way to handle a computationally heavy task is to put it in a background worker thread, while the main thread keeps handling the UI. Say for whatever reason I needed to do this the other way around: the main thread doing the grunt work…
3
votes
2 answers

How to run a form with its own message pump?

I've an application where I need to open many forms which are heterogeneous to my own and run independently. My application then proceeds to block on long running operations (making those operations asynchronous is not possible). So I would like to…
esac
  • 24,099
  • 38
  • 122
  • 179
3
votes
1 answer

GUI message queues (message pump - parallel or series)

I can't seem to find an answer to this anywhere. I'm not sure if I know how to phrase it. Do messages destined for controls on a form process in parallel to each other? I was always under the impression we had one message pump per thread apartment,…
user1830285
  • 578
  • 8
  • 24
3
votes
3 answers

"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…
Luca
  • 11,646
  • 11
  • 70
  • 125
2
votes
1 answer

How to encapsulate user interaction in a single method

I'm using an external framework that defines an interface with a single method: bool Authenticate(); that is to contain the whole process of authentication, including user interaction (WinForms). What I would like to do is something like: bool…
Jacek Gorgoń
  • 3,206
  • 1
  • 26
  • 43
2
votes
2 answers

Is it OK to call "Application.DoEvents" while a modal progress dialog is up?

I have a lengthy process that I can't run asynchronously, so just like Explorer when you're copying files, I have a progress dialog. I show the dialog modally, then perform the operations (we'll call it copying files to keep it abstract), update…
Dave
  • 1,521
  • 17
  • 31
2
votes
0 answers

What's the status of message crackers from windowsx.h?

The windowsx.h header has a feature called "message crackers", which lets you use HANDLE_MSG and other macros to automatically decode WPARAM and LPARAM, as received by your window procedure, into a specific message's parameters. As of the Windows 10…
2
votes
3 answers

Ending a Program Mid-Run

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…
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
2
votes
2 answers

Should every VCL form has its own message loop/pump for threading?

I'm attempting to implement a MVP pattern in my latest project. Currently using the VCL library that comes with C++ Builder 2007. My thinking is I don't need to do Application->Run(), or worse Application->CreateForm() which creates a main form and…
pcunite
  • 1,197
  • 15
  • 23
2
votes
1 answer

Keep Inno Setup UI responsive during PrepareToInstall

In order to keep the Inno Setup UI responsive, I'm using a technique almost identical to the one described in How to execute 7zip without blocking the InnoSetup UI? In one of my [Files] entries, I defined an AfterInstall procedure which runs a…
Dan
  • 1,215
  • 1
  • 10
  • 22
2
votes
2 answers

Measuring UI responsiveness of a Windows app

Is there any metric for responsiveness of a WinForms/Windows application? Something like the percentage of time the message loop is blocked for? How can it be obtained?
chillitom
  • 24,888
  • 17
  • 83
  • 118
2
votes
2 answers

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…
Luca
  • 11,646
  • 11
  • 70
  • 125
1
vote
2 answers

Why does Application.Idle never fire when my form is hosted in a MFC application?

I'm building a .net plugin for a MFC application. I created a form using WinForms and .net4. The form is shown after user clicks a button in the MFC application. One of my controls uses Application.Idle to do some task. The problem is, it seems…
AZ.
  • 7,333
  • 6
  • 44
  • 62
1
vote
0 answers

windows message pump speed for all applications get lower when mouse points to desktop

Background: Our product has one instance of dedicated application (Win32 Delphi) for each device connected to our system. Recently we have a huge project where over 100 devices were connected, so our control application started 140-160 Win32…
Vasilich
  • 83
  • 7
1
vote
1 answer

summarizing contents of the Windows Message Queue?

We have a CF.NET 3.5 app that seems to work fine for about 4 hours before a specific bug appears: Once buggy, there is a delay of approx 30 seconds after a mouse click before the corresponding ..._MouseDown event is called. This indicates to me…
erict
  • 1,394
  • 2
  • 14
  • 28