The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Office redecoration: The classic Microsoft prank
Apr 1, 2009
Post comments count 0
Post likes count 0

Office redecoration: The classic Microsoft prank

Raymond Chen
Raymond Chen

Tim Sneath reminds us that it is a long-standing tradition Microsoft tradition to prank someone's office while they are out (here's a video of Larry Osterman's tales of prankdom). When I went to see a Thunderbirds hockey game a few years back, I avoided mentioning at the time that seeing the game served a secondary purpose. I attended the game with a couple of friends, one of whom had never seen a live hockey game before. It so happened that his fiancée wanted to prank his office, so our little hockey outing was a way to keep him occupied for a while, giving his fiancée the opportunity to sneak...

2009 Q1 link clearance: Microsoft blogger edition
Mar 31, 2009
Post comments count 0
Post likes count 0

2009 Q1 link clearance: Microsoft blogger edition

Raymond Chen
Raymond Chen

It's that time again: Sending some link love to my colleagues. Updates: Fixed name of product Microsoft Expression (no "s"). Also, I think Arvin's blog is still up—it's just being masked by a doppelganger. Will update as information becomes available.

Freudian typo? The spinlock
Mar 31, 2009
Post comments count 0
Post likes count 0

Freudian typo? The spinlock

Raymond Chen
Raymond Chen

I was typing up a document and somehow accidentally misspelled spinlock as sinlock. I was tempted to leave it.

What is the implementation of WM_PRINTCLIENT?
Mar 30, 2009
Post comments count 0
Post likes count 0

What is the implementation of WM_PRINTCLIENT?

Raymond Chen
Raymond Chen

Via the suggestion box, Martin Filteau asks Could you explain the implementation of WM_PRINTCLIENT? It seems that even MS got it wrong in the LISTBOX control. Try to AnimateWindow a window that as a LISTBOX control as a child. The LISTBOX displays correctly if it is NOT empty. However, if it is empty... nothing is drawn. I got a similar problem when embedding an Internet Explorer control. Thanks. -mf As I noted back in 2003, the implementation of WM_PRINTCLIENT is the same as that of WM_PAINT. In particular, the implementation of WM_PRINTCLIENT for an empty window is... to paint nothing. That's...

I drive a car the way most people use a computer
Mar 27, 2009
Post comments count 0
Post likes count 0

I drive a car the way most people use a computer

Raymond Chen
Raymond Chen

It was interesting to me reading the reactions to my adventures driving a manual transmission. People seemed to be spending a lot of time trying to convince me that if only I were to expend a bit more effort in learning the finer points of driving a manual transmission and log enough time behind the wheel, then the activity will become less taxing on my mental brainpower. But why should I care? To me, driving is not an end in itself. It is just a tool for solving the problem of getting from point A to point B. The less I have to learn about how to accomplish this task the better. My goal is not...

The inability to lock someone out of the registry is a feature, not a bug
Mar 26, 2009
Post comments count 0
Post likes count 0

The inability to lock someone out of the registry is a feature, not a bug

Raymond Chen
Raymond Chen

There is no way to lock the registry. Whereas you can open a file with a deny all sharing mode to prevent anyone else from opening the file, the registry has no such provision. You can't lock a registry key and prevent others from reading from or writing to it. There is an internal lock on the registry, but that's just to ensure that registry operations are atomic; that is, that if one thread writes a value to the registry and another thread reads that same value from the registry, then the value that comes back is either the value before the write took place or the value after the write took place, but not some ...

Caption contest: The pinball machine
Mar 25, 2009
Post comments count 0
Post likes count 0

Caption contest: The pinball machine

Raymond Chen
Raymond Chen

I may regret this, but here's something new: A caption contest. One of my colleagues saw this picture on a company's Web site. The original caption for this picture was something like Join our affiliate program or Score big with our affiliate program. Your mission is to come up with something funnier. Here are some ideas to get you started: Do you have balls of steel? Maybe you can become an affiliate. We love to flip off our affiliates. When you become an affiliate, you're going to get whacked around a lot. Sooner or later you'll end up in the hole. We like to play games with you. Become an affiliate today...

Double secret auto-arrange probation
Mar 24, 2009
Post comments count 0
Post likes count 0

Double secret auto-arrange probation

Raymond Chen
Raymond Chen

When you view a folder for the first time, Explorer arranges the items in a nice default pattern. And when items are added to the folder, they get added to the end. And when you delete an item from the folder... the other items auto-arrange to close the gap? But wait, if you look at the View options, the Auto-Arrange option is not set. So are we auto-arranging or not auto-arranging? Well, yes, but only until you touch it. As long as you express no interest in the placement of icons in a folder (and the desktop counts as a folder), then Explorer will auto-arrange them. But once you move an icon around, Exp...

What’s the point of the MoveWindow function when we already have SetWindowPos?
Mar 23, 2009
Post comments count 0
Post likes count 0

What’s the point of the MoveWindow function when we already have SetWindowPos?

Raymond Chen
Raymond Chen

Commenter Phil Quirk notes via the suggestion box, " is just a weird function. I guess it's easier to call than , but that's the only thing it seems to have going for it." Yup, that's about right. The function doesn't really do anything you couldn't already do yourself with . It's just a convenience function. And it you look at it pretty closely, it's really not that big of a convenience either, saving you one parameter () and replacing the flag with a boolean parameter. Whoop-dee-doo. It shouldn't take too much imagination to figure out how this situation came about. It's the same reason why you hav...