Maintaining a Responsive User Interface

The last section ended with a demonstration of an unresponsive UI. It is interesting to note why an application may become unresponsive.

Message Pump

Every Windows application has what is called a message pump. In reaction to user interaction, Windows sends Windows messages to the message queue of an application. In .NET, the message is handled for the developer and is translated into a friendly .NET event. For example, when the user taps the screen, Windows sends a WM_LBUTTONDOWN message (followed by a WM_LBUTTONUP) to the message pump of your application, and this is translated into MouseDown, MouseUp events and possibly, depending on the control, into a Click event. The main thread of your process is simply ...

Get Microsoft® Mobile Development Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.