Showing archive results for 2005

Apr 5, 2005
Post comments count0
Post likes count0

The dialog manager, part 6: Subtleties in message loops

Raymond Chen

Last time, I left you with a homework exercise: Find the subtle bug in the interaction between and the modal message loop. The subtlety is that sets some flags but does nothing to force the message loop to notice that the flag was actually set. Recall that the function does not return until a posted message arrives in the queue. If incomin...

Code
Apr 4, 2005
Post comments count0
Post likes count0

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

Raymond Chen

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 function uses the function t...

Code
Apr 1, 2005
Post comments count0
Post likes count0

The dialog manager, part 4: The dialog loop

Raymond Chen

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 DialogBoxInd...

Code
Mar 31, 2005
Post comments count0
Post likes count0

The dialog manager, part 3: Creating the controls

Raymond Chen

This is actually a lot less work than creating the frame, believe it or not. For each control in the template, the corresponding child window is created. The control's sizes and position is specified in the template in DLUs, so of course they need to be converted to pixels. The class name and caption also come from the template. There are al...

Code
Mar 31, 2005
Post comments count0
Post likes count0

Neuroscience in the service of basketball fans

Raymond Chen

Nick Shulz's Transition Game pointed out Slate's experiment in using neuroscience to distract opposing foul shooters. I thought this worth mentioning now that it seems that the entire country has been swept up in NCAA basketball fever.

Non-Computer
Mar 30, 2005
Post comments count0
Post likes count0

The dialog manager, part 2: Creating the frame window

Raymond Chen

The dialog template describes what the dialog box should look like, so the dialog manager walks the template and follows the instructions therein. It's pretty straightforward; there isn't much room for decision-making. You just do what the template says. For simplicity, I'm going to assume that the dialog template is an extended dialog template....

Code
Mar 29, 2005
Post comments count0
Post likes count0

Adventures in product testing: Candles that catch fire

Raymond Chen

Not to be outdone by frying pans that explode when you use them for frying, Nature's Finest Candles has issued a product recall [pdf] because the candles catch fire when you light them. This is not to be confused with birthday candles that catch fire and explode.

Non-Computer
Mar 29, 2005
Post comments count0
Post likes count0

The dialog manager, part 1: Warm-ups

Raymond Chen

I think a lot of confusion about the dialog manager stems from not really understanding how it works. It's really not that bad. I'll start by describing how dialog boxes are created over the next few articles, then move on to the dialog message loop, and wrap up with some topics regarding navigation. There will be nine parts in all. The first maj...

Code
Mar 28, 2005
Post comments count0
Post likes count0

When a program asks you a question and then gets upset if you answer it

Raymond Chen

JeffDav's story of a program that didn't like it when he told it where to install reminded me of another program that we dealt with during Windows 95 development. This was a big-name program developed by one of the biggest-of-the-big name software companies. Let's give this program the imaginary name "LitWare". Its setup program asked you w...

History
Mar 28, 2005
Post comments count0
Post likes count0

The CEO-to-English Phrase Book, a continuing series from Slate

Raymond Chen

I'm an economics geek, so of course I'm a fan of Slate's Moneybox column as well as The Dismal Science and most of all, Steven Landsburg's gleefully provocative Everyday Economics. I'm also a language geek, so I've been quite enjoying the occasional Moneybox articles which decode CEO speak into plain English titled The CEO-English Phrase Book, th...

Non-Computer