Windows Message Filtering
 
 
 

A common idiom used in progress dialogs is to remove all messages from the windows message queue except for paint messages and messages indicating that processing must be aborted (e.g. the escape key was pressed). By handling paint messages the application can continue to be responsive and prevent Windows from labeling the process as unresponsive.

Plug-in developers must allow certain windows messages (that are defined in the WM_USER message range) to be propagated to WPF controls. These messages are critical to the proper functioning of the 3ds Max application menu. The MaxSDK::WindowsMessageFilter class exposed in the SDK is the preferred way to safely filter windows messages, in the context of a progress dialog. This class ensures proper dispatch of messages, and can be used to allow the application to respond to paint updates.

We strongly recommend using the MaxSDK::WindowsMessageFilter class instead of rolling your own message filtering loop.

For more information and a code example see the MaxSDK::WindowsMessageFilter class documentation.