The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Why don't I use any class libraries in my sample code?
As a general rule, I avoid using any class libraries in my sample code. This isn't because I'm opposed to class libraries, but rather because I don't want to narrow my audience to "people who use MFC" (to choose one popular class library). If I were to start using MFC for all of my samples, I'd probably lose all the people who don't use MFC. "Oh, but those people can just translate the MFC code into whatever class library they use." Well, sure, they could do that, but first they would have to learn MFC. I wouldn't be talking about s and s any more but rather s and s. I would write "Add this to your handler", a...
There's not much luggage space, unless you dump the snow
Every year, Road and Track magazine reviews a strange vehicle in their April edition. Last year, it was the 1949 MG TC. But my favorite is their 2005 review of the Zamboni 500. [T]he Zamboni leaves the line with alacrity (revved to its 3000-rpm redline), rockets up to 9.7 mph and then stays at exactly that speed for the full 200-ft. length of the rink. Those old myths that you will "black out" or "be unable to breathe" at speeds above 9.5 mph proved to be completely untrue. I was perfectly comfortable, once I got over the excitement, and felt no ill effects then or later. There's not much luggage space, u...
Why can't you set the command prompt's current directory to a UNC?
If you try to set the current directory of a command prompt, you get the error message "CMD does not support UNC paths as current directories." What's going on here? It's MS-DOS backwards compatibility. If the current directory were a UNC, there wouldn't be anything to return to MS-DOS programs when they call function 19h (Get current drive). That function has no way to return an error code, so you have to return a drive letter. UNCs don't have a drive letter. You can work around this behavior by using the command to create a temporary drive letter for the UNC. Instead of passing to the function as the , yo...
Technology hypochondriacs
One phenomenon I've noticed quite a bit is something I'm going to call "technology hypochondria", the belief that you are suffering from whatever problem you just read about. It reminds me of this joke: A man goes to his doctor. "Doctor," he says, "I'm pretty sure I've got this disease here. All the symptoms match. I'm suffering from fatigue, sleeplessness, irritability, and memory loss." "Mr. Jenkins," the doctor responds, "I'm fairly certain you aren't suffering from menopause." One of my relatives who is a medical doctor in a public hospital explained to me that in his experience, you should neve...
Email tip: Barry Leiba expounds on subject lines
Barry Leiba extends my previous remarks on choosing meaningful subject lines with his own contribution to the cause. Of particular interest is his note on how to choose a subject line for meeting requests.
Email tip: Don't add people to a thread without saying why
If you add me to an existing discussion, you have to say why. Do you have a specific question for me? Do you want my opinion on something? Are you just sharing a funny joke? Sometimes, I'll get a piece of mail that goes like this: From: Xxxxx To: Aaaaa; Bbbbb; Ccccc; Raymond Adding Raymond. --- Original Message --- ... Gee, that's very nice of you to add me, but you didn't say why. Is this a FYI? Is there a question you want answered? Often, the discussion is just "Gosh, there's this bug, person A proposes a theory, person B proposes a counter-theory, person C runs some tests and has some p...
Performance evaluation euphemisms invading everyday speech (ironically)
There was a morning meeting event at which donuts were provided as an enticement. Someone commented on the food thus: "These donuts failed to meet expectations." Peter Sagal remarked that the phrase "emerging to standard" has entered currency in his family as a euphemism for "substandard". (Opening panel round, final question, time code 1:20.) However, the proposal to replace "failed" with "deferred success" was ultimately defeated.
Why doesn't the window manager unregister window classes when the owning DLL unloads?
If you look at the documentation for the function, you'll see that it calls out different behavior depending on whether you're running Windows 95 or Windows NT. Commenter Vipin asked why Windows NT doesn't follow Windows 95's lead. Back in the old days, 16-bit Windows did unregister classes automatically when a DLL unloaded. It had to do this since all of 16-bit Windows ran in a single address space. If a module's classes were not unregistered when it was unloaded, then all of these leaked classes would clog up the system until it was restarted. Since instance handles were just selectors, a...
Long Zheng interviews Hamad Darwish about those Windows Vista wallpapers
Long Zheng followed up on the story of where the default wallpapers in Windows Vista came from and managed to score an interview with Hamad Darwish, one of those amateur photographers.