The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Why are there two values for PSH_WIZARD97?
Apr 23, 2009
Post comments count 0
Post likes count 0

Why are there two values for PSH_WIZARD97?

Raymond Chen
Raymond Chen

Welcome, Slashdot readers. Remember, this Web site is for entertainment purposes only. If you go cruising through the commctrl.h header file, you'll find that there are two different definitions for PSH_WIZARD97: #if (_WIN32_IE >= 0x0400) ... #if (_WIN32_IE < 0x0500) #define PSH_WIZARD97 0x00002000 #else #define PSH_WIZARD97 0x01000000 #endif ... Why are there two values for PSH_WIZARD97? Set the wayback machine to 1997. (Note: Dates are approximate.) The user interface design team studied how Windows 95 wizards have been faring and have begun using what they've learned t...

If you can’t find the statistics you want, then just make them up
Apr 22, 2009
Post comments count 0
Post likes count 0

If you can’t find the statistics you want, then just make them up

Raymond Chen
Raymond Chen

Yesterday, the Wall Street Journal reported on America's Newest Profession: Bloggers for Hire and included this handy little chart: I found this number hard to believe, so I followed the Source link to the information from the Bureau of Labor Statistics. I found that, yup, in a May 2007 survey, the Bureau of Labor Statistics estimated that there were indeed 555,770 lawyers, 394,710 computer programmers, 299,160 chief executives, and 289,710 fire fighters in the United States. Bloggers? Didn't even make the list. The number 452,000 appears nowhere in the Bureau of Labor Statistics report. If you can't f...

What structure packing do the Windows SDK header files expect?
Apr 22, 2009
Post comments count 0
Post likes count 0

What structure packing do the Windows SDK header files expect?

Raymond Chen
Raymond Chen

/Zp8 In words, integral types and pointers up to eight bytes in size are stored at their natural alignment. Larger types are stored at eight-byte alignment. In other words (saying it a third time), let be an integral or pointer type. If ≤ 8, then is aligned at a -byte boundary. If ≥ 8, then is aligned at an 8-byte boundary.

How to answer the telephone, according to the manual
Apr 21, 2009
Post comments count 0
Post likes count 0

How to answer the telephone, according to the manual

Raymond Chen
Raymond Chen

I have a fancy new office telephone with a bajillion features (most of which I will never even find, much less use). The telephone comes with a helpful manual, explaining how to carry out various tasks. For example: Answering a Call Using the Handset: Pick up the handset. Cool, I was wondering about that.

Principles of economics, translated
Apr 20, 2009
Post comments count 0
Post likes count 0

Principles of economics, translated

Raymond Chen
Raymond Chen

Yoram Bauman, the stand-up economist translates Mankiw's ten principles of economics into English. The proof presented in the footnote to principle 5, as well as an extended version of the translation, can be found in the Annals of Improbable Research.

The dangers of destroying a window while it is processing a sent message
Apr 20, 2009
Post comments count 0
Post likes count 0

The dangers of destroying a window while it is processing a sent message

Raymond Chen
Raymond Chen

Commenter BryanK wonders why weird things happen if you destroy a window while it is processing the message. He suspects that it's similar to the problems you encounter when you destroy a window in response to the message. Although I haven't studied the situation, I wouldn't be surprised if the problem is indeed entirely analogous. It just follows from general programming principles: After all, you are destroying the active window. The message is sent as part of the activation change, and the documentation says that the message is sent "when a window belonging to a different application than the active wi...

Why is the animation common control limited to RLE8-compressed animations?
Apr 17, 2009
Post comments count 0
Post likes count 0

Why is the animation common control limited to RLE8-compressed animations?

Raymond Chen
Raymond Chen

The animation common control is very limited in the type of animations it can play. The animation must be in AVI format, it cannot have any sound, and it must be either uncompressed or use RLE8 compression. Why so many restrictions? Because if it could handle other file formats, play sound, and support arbitrary codecs, it would just be a reimplementation of the multimedia animation control. (We saw this principle earlier when discussing why you can't do everything with registry values that you can do with registry keys.) The point of the animation common control is to play very simple animations without th...

The frustration of people who are not interested in why something works but only interested in the magic phrase they need to type
Apr 16, 2009
Post comments count 0
Post likes count 0

The frustration of people who are not interested in why something works but only interested in the magic phrase they need to type

Raymond Chen
Raymond Chen

It's frustrating when people who are presumably smart (or who are at least pretending to be) have a problem and are satisfied to receive the magic phrase they need to type with no interest at all in understanding why the magic phrase works. For example, here's a question sent to an internal mailing list for users of something I'll call Program Q. From: X Why is it that after I use program Q to create a table, nothing else works? Here's a batch file I've written: q create table newtable pause q create table newtable2 The pause command never executes; in fact, nothing in the batch file executes after t...

Taxes redux: You can’t open the file until the user tells you to open it
Apr 15, 2009
Post comments count 0
Post likes count 0

Taxes redux: You can’t open the file until the user tells you to open it

Raymond Chen
Raymond Chen

One of the so-called taxes of software development on Windows is being respectful of Hierarchical Storage Management. You can't open a file until the user tells you to open it. This rule has consequences for how Explorer extracts information about a file, because what you definitely don't want is for opening a folder full of archived files in Explorer to result in all the files being recalled from tape. (Actually, file recall is just an extreme case of the cost of opening the file. You run into a similar problem if the file is on a slow medium or over a slow network connection. But just to motivate the discussio...