The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
The thread that gets the DLL_PROCESS_DETACH notification is not necessarily the one that got the DLL_PROCESS_ATTACH notification
The thread that gets the notification is not necessarily the one that got the notification. This is obvious if you think about it, because the thread that got the notification might not even exist any longer when the DLL is unloaded. How can something that doesn't exist send a notification? Even so, many people fail to realize this. You can't do anything with thread affinity in your or handler since you have no guarantee about which thread will be called upon to handle these process notifications. Of course, you're not supposed to be doing anything particularly interesting in your handler anyway, but thin...
News flash: Children are influenced by advertising
Anything in a McDonald's wrapper tastes better, according to children ages 3 to 5. Even something like carrots taste better if you put them in a McDonald's wrapper or cup.
First, try reading the error message, episode 2: Even programmers see error messages without reading them
I will occasionally note that users don't read error messages; they just click Cancel. And the phenomenon isn't just restricted to naïve users. Even programmers ignore error messages. All they see is "Blah blah blah an error occurred." For example, there's this message that appeared on a peer-to-peer discussion group: I tried to submit an update to our database and I got this error. What does it mean? Is the error on the client or the server? Opening transaction 34508. Locking record 14 for update. Updating record 14 in table BLUECHEESE. Operation failed. write: The file or directory is corrupted a...
Spam trackback attack week 3 statistics
The people who run this site think they have a handle on the trackback spam attack that raged for three and a half weeks. All the bad IP addresses have been blocked, and hopefully we didn't lose any babies with the bathwater. Here are the statistics for the final wave:
Yet another experiment in motivating people to find and fix bugs
Everybody has probably heard about some project where management decided to motivate testers and programmers by rewarding testers for finding bugs and programmers for fixing them. In the absence of high ethical standards, this can devolve into the situation known to Dilbert fans as I'm gonna write me a new minivan. I experimented with this idea once, over a decade ago. Well, not exactly this idea, but a variation of it: For each bug in my code which I fixed, I paid the tester who found it. The risk here would be that I would intentionally resolve bugs as INVALID (or WONTFIX or anything other than FIXED) in...
Oh great, and my phone even has a CPU meter
These fancy-dancy IP phones never cease to make me wonder what our world has come to. I remember when a telephone was a bucket of carbon granules and a momentary switch, and the rotary dial was just a mechanism for going on and off hook at a precise frequency. (Indeed, sometimes for fun, I'll pulse-dial a phone by tapping on the hook.) The other day, somebody sent out an email message: I'm amusing myself watching the "CPU Load" graph on the phone. Then again, I'm easily amused. Naturally, the CPU meter is useless, because you can only switch to it when you're not using the phone. Once you pick up the hand...
High school students guess what happens to money deposited into checking accounts
In August 2007, the results of the first nationwide high school economics graduation tests were released. (Download the report [pdf].) It appears that the results were better than expected, but let's not celebrate too quickly: The results were that 42% of students rated "Proficient" and 3% "Advanced". And only 52% of the students could answer this multiple-choice question correctly: What happens to most of the money deposited in checking accounts at a commercial bank? I guess 48% of the students have never seen It's a Wonderful Life.
Why does a flashing taskbar result in a fullscreen console returning to windowed mode?
Commenter Daniel wonders why a flashing taskbar results in a fullscreen console returning to windowed mode. I didn't know the answer to this, but I formulated a guess, and I was ready to just post my guess. (Because everything I write is just conjecture anyway. Informed conjecture, but still.) But I had some time, so I went spelunking through the code history and about a half hour later, I found confirmation for my guess, so now it's not just a guess but a fact. (Don't expect me to go to all this effort in general. Guessing is a lot less time-consuming.) The code to force a fullscreen console into windowed ...
The butter and the money for the butter
In a discussion a few years ago, I saw the phrase, "Now you have the butter and the money." This was new to me, and a little Web searching (guided in part by a guess at the author's nationality) revealed it to be a French proverb, the full version of which is On ne peut pas avoir le beurre et l'argent du beurre: "You can't have the butter and the money for the butter." It's a really nice phrase, and maybe someday I'll be able to use it. Bonus butter idiom: Reading the blog of a German colleague, I ran across the phrase alles wieder in Butter ("everything back in butter"), which from context appeared to mean som...