The Old New Thing

The dialog manager, part 8: Custom navigation in dialog boxes

Some dialog boxes contain custom navigation that goes beyond what the IsDialogMessage function provides. For example, property sheets use Ctrl+Tab and Ctrl+Shift+Tab to change pages within the property sheet. Remember the core of the dialog loop: (Or the modified version we created in part 7.) To add custom navigation, just stick...
Comments are closed.0Code

The dialog manager, part 7: More subtleties in message loops

Last time, we solved the problem with the EndManualModalDialog function by posting a harmless message. Today, we're going to solve the problem in an entirely different way. The idea here is to make sure the modal message loop regains control, even if all that happened were incoming sent messages, so that it can detect that the fEnded flag ...
Comments are closed.0Code

The dialog manager, part 6: Subtleties in message loops

Last time, I left you with a homework exercise: Find the subtle bug in the interaction between EndManualModalDialog and the modal message loop. The subtlety is that EndManualModalDialog sets some flags but does nothing to force the message loop to notice that the flag was actually set. Recall that the GetMessage function does not return ...
Comments are closed.0Code

The dialog manager, part 5: Converting a non-modal dialog box to modal

Let's apply what we learned from last time and convert a modeless dialog box into a modal one. As always, start with the scratch program and make the following additions: Not a very exciting program, I grant you that. It just displays a dialog box and returns a value that depends on which button you pressed. The DoModal function uses ...
Comments are closed.0Code

The dialog manager, part 4: The dialog loop

The dialog loop is actually quite simple. At its core, it's just If you want something fancier in your dialog loop, you can take the loop above and tinker with it. But let's start from the beginning. The work happens in DialogBoxIndirectParam. (You should already know by now how to convert all the other DialogBoxXxx functions into ...
Comments are closed.0Code