The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Feb 22, 2011
Post comments count 0
Post likes count 1

Dr. Watson and the bluescreen – a story from the trenches

Raymond Chen

A fellow Microsoft employee volunteered a story from his prior work at a hospital as their enterprise architect. I received an escalation from our Tier 1 service desk on a Dr. Watson. Why would I get a simple escalation? Strange... Since I hadn't seen the outside of my cubicle for a while, I decided to walk over to talk to the customer in person. The employee having the problem was named Dr. Watson. His computer had bluescreened. I still get a chuckle out of that years later. That little unexpected name collision threw twelve people in the IT service and support teams into disarray.

Feb 21, 2011
Post comments count 0
Post likes count 0

Sharktopus: Just when you thought it was safe to see what movies are coming out

Raymond Chen

Sharktopus: Half-shark. Half-octopus. All-killer. I am not making that up. The Web site is sharktopusmovie.com, presumably because sharktopus.com was already taken. I am not making that up. I guess they wanted to ride the coattails of Megashark vs. Giant Octopus? Even more disturbing discovery: Megashark vs. Giant Octopus has a sequel: Megashark versus Crocosaurus. One of my colleagues says that he's going to wait for the sequel: Sharktopuses on a Plane.

Feb 21, 2011
Post comments count 0
Post likes count 1

If an operation results in messages being sent, then naturally the target window must be processing messages for the operation to complete

Raymond Chen

If an operation includes as part of its processing sending messages, then naturally the target window for those messages must be processing messages (or more precisely, the thread which owns the target window must be processing messages) in order for the operation to complete. Why? Because processing messages is the only way a window can receive messages! It's sort of tautological yet not obvious to everyone. Generally you run into this problem when you try to manipulate a window from a thread different from the one which created the window. Since windows have thread affinity, operations from off-thread typical...

Feb 18, 2011
Post comments count 0
Post likes count 1

WM_NCHITTEST is for hit-testing, and hit-testing can happen for reasons other than the mouse being over your window

Raymond Chen

The message is sent to your window in order determine what part of the window corresponds to a particular point. The most common reason for this is that the mouse is over your window. Although triggers most often for mouse activity, that is not the only reason why somebody might want to ask, "What part of the window does this point correspond to?" Consider a program that wants to beep when the mouse is over the Close button. This is an artificial example, but you can use your imagination to come up with more realistic ones, like showing a custom mouseover animation or displaying a balloon tip if the doc...

Feb 17, 2011
Post comments count 0
Post likes count 1

What is the highest numerical resource ID permitted by Win32?

Raymond Chen

A customer asked the following question: What is the maximum legal value of a resource identifier? Functions like take a as the resource ID, which suggests a full 32-bit range, but in practice, most resource IDs appear to be in the 16-bit range. Is there any particular history/precedent for avoiding large numbers as resource IDs? (I have a program that autogenerates string IDs, and having a full 32-bit range gives me some more flexibility in assigning the IDs, but I want to make sure I don't run afoul of any limitations either.) Let's answer the literal question first, and then look at the misconceptions behi...

Feb 16, 2011
Post comments count 0
Post likes count 1

What is the difference between a directory and a folder?

Raymond Chen

Windows 95 introduced Windows Explorer and along with it the term folder. What is the relationship between folders and directories? Some people believe that Windows 95 renamed directories to folders, but it's actually more than that. Windows Explorer lets you view folders, which are containers in the shell namespace. Directories are one type of folder, namely, folders which correspond to file system locations. There are other types of folders, such as Control Panel or Network Neighborhood or Printers. These other types of folders represent objects in the shell namespace which do not correspond to fil...

Feb 15, 2011
Post comments count 0
Post likes count 0

Don't mention the war. I mentioned it once, but I think I got away with it all right (Episode 2)

Raymond Chen

In preparation for the 2012 Olympic Games in London, the official UK tourism bureau produced tips for dealing with people from other countries.

Feb 15, 2011
Post comments count 0
Post likes count 1

Window message parameters do not come with metaphysical certitude

Raymond Chen

The MSDN documentation for window messages describes what each of the parameters means, but just because it means something doesn't mean that it is that something; it merely means it. But you knew this already. If you have a window handle, you can send it whatever message you like, with whatever parameters you like, even if those parameters contradict reality. For example, you could write some code that seeks out a target window and sends it a with parameters that claim that the message was generated from a keyboard accelerator, when in fact it was generated by code contained within your custom control. But you...

Feb 14, 2011
Post comments count 0
Post likes count 1

What happens when you email the people in the I'm a PC commercial?

Raymond Chen

In 2008, the first I'm a PC ad aired, opening with Sean Siler doing an impression of John Hodgman portraying a PC, and continuing with montage of people proudly announcing, "I'm a PC!" Accompanying the first four people to appear on screen are email addresses. The addresses are live (or at least they were when the campaign launched), and if you write to them, you get an autoresponse. I've heard that the most popular of the four email addresses in terms of incoming volume was not Sean Siler's, nor was it the one belonging to Bill Gates. Rather, the most messages arrived from people trying to contact the young...