Raymond Chen

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

Post by this author

Using SystemParametersInfo to access user interface settings

The function gives you access to a whole slew of user interface settings, and it is the only supported method for changing those settings. I'm not going to list every single setting; go read the list yourself. Here are some highlights: Here are some control panel settings. Notice that when using the SPI_SET* commands, you also have to...

Keep your eye on the code page

Remember that there are typically two 8-bit code pages active, the so-called "ANSI" code page and the so-called "OEM" code page. GUI programs usually use the ANSI code page for 8-bit files (though utf-8 is becoming more popular lately), whereas console programs usually use the OEM code page. This means, for example, when you open an 8-bit ...

A timed context menu

This is sort of in the same spirit as our previous exercise in writing a timed message box, but this is much easier. Here, we use the handy-dandy message to get us out of menu mode. Before displaying the menu, we set a timer. (And we use a thread timer because we don't own the window and therefore don't know what timer IDs are safe to ...

Modality, part 8: A timed MessageBox, the better version

A few days ago, we saw a simple version of a timed message box which had a limitation that it could be used from only one thread at a time. Today we'll work to remove that limitation. As you may recall, the reason why it could be used from only one thread at a time was that we kept the "Did the message box time out?" flag in a global. To ...

Raymond's random walk, from Swedish designers to Mr. Monkey

My random walk began at Svenska Dagbladet and the article Svensk designer upprör skottar, about Swedish designer Johanna Larson whose T-shirt depicting the traffic-cone-wearing Duke of Wellington has sparked a debate in the city. The article mentions that the tradition of placing a traffic cone on the head of the Duke is twenty years ...

The bonus window bytes at GWLP_USERDATA

The window manager provides a pointer-sized chunk of storage you can access via the constant. You pass it to the function and the function to read and write that value. Most of the time, all you need to attach to a window is a single pointer value anyway, so the free memory in is all you need. Note that this value, like the other ...

Curling proves itself much more exciting than hockey this year

NPR reports on an amazing last-rock shot at the Canadian women's curling championship (includes link to CBC video). It's odd hearing Melissa Block discussing curling in decidedly non-curling terms (for the benefit of the decidedly non-curling US listenership). One of the advantages of living in the Seattle area is that you can get all the ...

The scratch window

Sometimes you need a quick and dirty window and you don't want to go through all the hassle of registering a class for it. For example, you might need a window to do a brief snippet of DDE, or you just need a window to own a message box. To save yourself the trouble of registering a class for every single weenie thing you might need a ...

Suggestion Box 2

Post suggestions for future topics here instead of posting off-topic comments. Note that the suggestion box is emptied and read periodically so don't be surprised if your suggestion vanishes. (Note also that I am under no obligation to accept any suggestion.)Topics I are more inclined to cover: Topics I am not inclined to cover: (Due to the ...

Modality, part 7: A timed MessageBox, the cheap version

As we noted at the end of part 3, now that you know the conventions surrounding the message you can put them to your advantage. The more robust you want the function to be, the more work you need to do. Here's the cheap version, based on the sample in the Knowledge Base, but with some additional bug fixes. This function acts ...