The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

PSM_ISDIALOGMESSAGE is to modeless property sheets as IsDialogMessage is to modeless dialog boxes
Mar 9, 2010
Post comments count 0
Post likes count 0

PSM_ISDIALOGMESSAGE is to modeless property sheets as IsDialogMessage is to modeless dialog boxes

Raymond Chen
Raymond Chen

Dialog boxes and property sheets are similar in that most of the time, you use them modally. You call or , and the function doesn't return until the user closes the dialog box or property sheet. But you can also use dialog boxes and property sheets modelessly, using or by including the flag when you call . One of the more common problems people have when managing a modeless property sheet is finding that keyboard navigation doesn't work. The reason is the same as with modeless dialog boxes: You forgot to process dialog messages. But if you use the wrong function to process the dialog messages, then you don't...

The best actors in the business still lean into the microphone when they talk
Mar 8, 2010
Post comments count 0
Post likes count 0

The best actors in the business still lean into the microphone when they talk

Raymond Chen
Raymond Chen

Now let me get this straight. The Oscars honor, among other things, the best actors in Hollywood. These are people who have devoted their professional careers to reciting dialog in front of a camera and making it look spontaneous and natural. But for some reason, put them on stage at the Oscars, and instead of reciting dialog spontaneously and naturally, they read it stiltedly and lean into the microphone while doing it. And these are the best actors in the business?¹ It's like hosting a music award show and finding that all the performers suck at singing. ¹Oh wait, sorry, it's not a business. It'...

Why doesn't double-right-click bring up the Properties dialog?
Mar 8, 2010
Post comments count 0
Post likes count 0

Why doesn't double-right-click bring up the Properties dialog?

Raymond Chen
Raymond Chen

kip asks why double-right-click isn't a shortcut for Properties. Recall the logical consequences of the way Windows converts single-clicks into double-clicks. The double-click action is an extension of the single-click action. In the case of context menus, the proposed double-right-click action is not an extension of the single-right-click, because the single-right-click displays a menu, whereas the double-right-click would go directly to the Properties dialog. Indeed, the way context menus are positioned on the screen specifically negates the possibility of double-right-click, for the context menu positions ...

Delegation of responsibilities within a family during pregnancy
Mar 5, 2010
Post comments count 0
Post likes count 0

Delegation of responsibilities within a family during pregnancy

Raymond Chen
Raymond Chen

When friends of mine were expecting their first child, the wife frequently received comments like "That's okay. You're eating for two now." The husband had a response ready: "If she's eating for two, I'm drinking for three!"

How do I access the magic IEEE floating point values like NaN in code?
Mar 5, 2010
Post comments count 0
Post likes count 0

How do I access the magic IEEE floating point values like NaN in code?

Raymond Chen
Raymond Chen

There are functions like , , , and for detecting that a floating point value is one of the special values like NaN, but how do you actually generate one of these values? You can access these values from the template. Wait, where's negative infinity? The compiler folks provided these handy little definitions for when you need to generate a special value (as opposed to merely detecting one), and for which the template comes up short. Disclaimer: Applies to Microsoft Visual Studio. Your mileage may vary. Use the template when available. Bonus chatter: Note that you must use functions like to detect...

Everyday is Grammer Day
Mar 4, 2010
Post comments count 0
Post likes count 0

Everyday is Grammer Day

Raymond Chen
Raymond Chen

March fourth is not just a pun on march forth, but it's also National Grammar Day, sponsored by the Society for the Promotion of Good Grammar.

What happens if I drag the mouse by exactly the amount specified by SM_CXDRAG?
Mar 4, 2010
Post comments count 0
Post likes count 0

What happens if I drag the mouse by exactly the amount specified by SM_CXDRAG?

Raymond Chen
Raymond Chen

The drag sensitivity is specified by the system metrics and . What happens if I drag the mouse by exactly the amount specified by these two parameters? Nothing. These parameters control the drag insensitivity of the mouse. If your mouse motion is less than or equal to this amount, then nothing happens. This is spelled out in the documentation for : The number of pixels on either side of a mouse-down point that the mouse pointer can move before a drag operation begins. It's how far the mouse can move before the system detects a drag. In code, the algorithm is as follows: Some people appear to have re...

Voicemail security, even stronger than bank security
Mar 3, 2010
Post comments count 0
Post likes count 0

Voicemail security, even stronger than bank security

Raymond Chen
Raymond Chen

Microsoft's telephone department takes security very seriously. Your voicemail password must be at least eight digits long. By comparison, the password for my ATM card is only four digits long. Because voicemail is that important, I guess. (Yes, I know about two-factor authentication. I'm writing this only half-jokingly.)

Microspeak: Dialogue
Mar 2, 2010
Post comments count 0
Post likes count 0

Microspeak: Dialogue

Raymond Chen
Raymond Chen

Why have a conversation when you can dialogue? I think this is minimal work, but do others care? If they don't, then this is one for the ideas that failed bin. If they do, well let's dialogue... No need to talk when you can dialogue.