The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts

What’s with this MSH_MOUSEWHEEL message?

The hardware folks had this mouse wheel thing they were making, and they needed a way to get applications to support the mouse. Now, one way of doing this was to say, "Well, we'll start selling this wheel mouse, but no applications can use it until the next version of Windows is released, one that supports the wheel." Of course, that would have meant waiting until Windows NT 4 came out, and who know when that would be. Plus it meant that people would have to upgrade Windows in order to take advantage of their fancy new mouse. As you can imagine, they weren't too pleased with the "wait a few years" plan...

AOL is moving closer to jettisoning dial-up, except for one person

When I read this story that AOL is ready to spin off their dial-up service, I wondered if they will remember to give the new dial-up number to the winner of that contest.

Microspeak: The long pole

The long pole is the part of the project that is on the critical path due to its length. For example, if you have a project that consists of three independent sub-projects, then the sub-project with the longest completion date is the long pole. The etymology of this term is simultaneously obvious yet hard to pin down. Intuitively, the long pole is the one that determines the height: If you have a tent supported by three poles, then the long pole decides how tall the tent is. If you have a collection of poles you want to put in the back of a pick-up truck, the long pole is the one that decides how big a bed you ...

Why, when you sort by name, doesn’t it actually sort by name?

When you right-click on the desktop or in an Explorer window and select "Sort by... Name", why doesn't it actually sort by name? Because "Sort according to the default sort order for the column whose title is... Name" is too long. The default sort order for the first column (whose name is "Name") is to sort by name, mostly. The actual sort order for the desktop and file folders (note: implementation detail, subject to change at any time) is really a two-tiered sort. First, the items are sorted into buckets; the first bucket contains the virtual folders, the second bucket contains file folders (directories),...

I warned you: The dangers of attaching input queues

Some people didn't take to heart my cautions on the subject of attached input queues, item number five on the list of five things every Win32 programmer should know. And then they find that their application stops responding. // Code in italics is wrong void TryToStealFocus(HWND hwnd) { // First try plain SetForegroundWindow SetForegroundWindow(hwnd); HWND hwndFG = GetForegroundWindow(); if (hwndFG == hwnd) return; // That didn't work - if the foreground window belongs // to another thread, attach to that thread and try again DWORD dwCurrentThread = GetCurrentThreadId(); DWORD dwFGThread = Ge...

Don’t be helpless: You can put things together, it doesn’t have to be a single command

Humans are distinguished among all animal species by their advanced development of and heavy reliance on tools. Don't betray your ancestors. Use those tools you have. For example, during the debugging of a thread pool problem, it looked like somebody did a PostThreadMessage to a thread pool thread and left the message unprocessed after the thread pool function returned. Who could it have been? Well, one idea was to see if there were any DLLs in the system which called both QueueUserWorkItem and PostThreadMessage. I did a little legwork and contributed the following analysis to the mail thread: Of all the ...

What does each country claim for its own?

One of the things that fascinates me is how each country's view of history is clouded by its own chauvinism. I was reminded of this when researchers were able to reconstruct the original recording from a phonautograph which predated Edison's phonograph, thereby adding another claim to the mix of who invented sound recording. I think the most contentious invention belongs to human flight. It seems that every country on the planet has a claim to being the pioneer in this field. I'm particularly amused that both France and Brazil claim Alberto Santos-Dumont as their own. Failure is an orphan. When I visited ...

When I double-click an Excel spreadsheet, Excel opens but the document doesn’t

Sometime last year, we got a report from a customer that whenever he double-clicks an Excel spreadsheet, Excel starts up, but the document isn't loaded. Instead, he gets an error message saying that document could not be found. He has to go to the Open dialog and open the spreadsheet manually. This report was routed to the shell team, since it appeared to be an Explorer problem. We studied the file type registration for Excel documents; those were fine. We suggested some breakpoints, but everything looked good there, too. Even reported that the "Open" command was being sent to Excel correctly. So far as the sh...

The sign that a trend is over: It shows up in a movie

George Mannes talks with Mike Pesca on his observation that once a financial trend shows up in a movie or television show, it's over.