The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Betsy's interview tip: Wear pants
Mar 10, 2006
Post comments count 0
Post likes count 0

Betsy's interview tip: Wear pants

Raymond Chen
Raymond Chen

Last year, our retiring Blog Queen Betsy Aoki reminded us to wear pants.

Why does the size of a combo box include the size of the drop-down?
Mar 10, 2006
Post comments count 0
Post likes count 1

Why does the size of a combo box include the size of the drop-down?

Raymond Chen
Raymond Chen

Many people are surprised to discover that when you create a combo box (either in code via or indirectly via a dialog box template), the size you specify describes the size of the combo box including the drop-down list box, even though the drop-down list box is not visible on the screen. For example, if you say that you want the combo box to be 200 pixels tall, it will be visible on the screen as a 20-pixel-tall (say) edit control, and when the user drops the list box by clicking on the drop-down arrow, the list box will be 180 pixels tall. This has the unfortunate consequence that if you fail to take ...

If you ask for a window caption, you also get a border
Mar 9, 2006
Post comments count 0
Post likes count 0

If you ask for a window caption, you also get a border

Raymond Chen
Raymond Chen

Some people may have noticed that the is defined as the combination of and : Since includes , it is impossible to get a caption without a border. Sometimes people don't quite get this and keep asking the question over and over again, and I have to keep trying to explain the laws of logic in different ways until one of them finally sinks in. "I noticed that if I set the style, I get a window with a title bar and a border. I don't want the border. How do I get rid of the border? I tried all sorts of combinations of window styles but none of them get me what I want." "If you look at the definition, in...

Reading the fine print, episode 3: What's in the bottle?
Mar 9, 2006
Post comments count 0
Post likes count 0

Reading the fine print, episode 3: What's in the bottle?

Raymond Chen
Raymond Chen

Caught out by the FDA. I happened to be in the bug spray section of the store when I spotted a bottle of mosquito repellant that proudly proclaimed "100% DEET". But the FDA-mandated labelling tells a different story: 95% 5% Similarly, foods labeled "zero fat" are actually allowed to contain up to a half gram of fat. (Well, up to but not including.) This is a definition of "zero" with which I had previously been unfamiliar. (Episode 1, Episode 2.)

Reading the fine print, episode 2: Portable headphones
Mar 8, 2006
Post comments count 0
Post likes count 0

Reading the fine print, episode 2: Portable headphones

Raymond Chen
Raymond Chen

Marketing writes the big print; lawyers write the small print. I bought some portable stereo headphones. The front of the box says you can use it "while in-line skating, power walking, biking, jogging, skiing, running, weightlifting, climbing and more." (Emphasis mine.) The back of the box says that it should not be used "while driving or cycling." (Episode 1.)

Why is there no message for disabling the Cancel button on a wizard?
Mar 8, 2006
Post comments count 0
Post likes count 0

Why is there no message for disabling the Cancel button on a wizard?

Raymond Chen
Raymond Chen

Some people have noticed that there is no message that lets you disable the Cancel button on a wizard. This is on purpose. Usability studies reveal that users find it extremely frustrating when they get partway through a wizard and then decide they don't want to perform the operation after all, but find that the wizard doesn't give them a way to cancel. Now the user feels trapped. They can't back out of the operation; they're being forced to finish something against their will. Imagine if you went to an e-commerce site and started going through the checkout procedure, then decide that you didn't want to buy the ...

Raymond, you even pose like a girl
Mar 7, 2006
Post comments count 0
Post likes count 0

Raymond, you even pose like a girl

Raymond Chen
Raymond Chen

Okay, so it's bad enough that I write like a girl. (And so does Betsy.) Now, Korby Parnell reported on a little get-together of some Microsoft bloggers, and in the photograph you can see that I'm doing the "peace" sign, just like young Japanese women do in photographs. Apparently, boys are supposed to strike a superhero pose, but the peace sign is so much more fun.

The consequences of invalidating the null window
Mar 7, 2006
Post comments count 0
Post likes count 0

The consequences of invalidating the null window

Raymond Chen
Raymond Chen

On occasion, you might notice that every window on the desktop flickers and repaints itself. One of the causes for this is a simple null handle bug. The function is one you're probably well-familiar with. It is used to indicate to the window manager that the pixels of a particular window are no longer current and should be repainted. (You can optionally pass a rectangle that specifies a subset of the window's client area that you wish to mark invalid.) This is typically done when the state of the data underlying the window has changed and you want the window to repaint with the new data. If however you end up ...

Other things happen for a reason, too
Mar 6, 2006
Post comments count 0
Post likes count 0

Other things happen for a reason, too

Raymond Chen
Raymond Chen

Today's theme is a quick one: Other Microsofties explain what at first appear to be puzzling decisions.