The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
News flash: Doing something that requires your attention reduces your ability to do other things at the same time which also require your attention
The New York Times points out that if you engage in an activity that requires your attention, then it reduces your ability to do other things at the same time which also require your attention. For some reason, however this is news when one of those things is sending text messages. I wonder if, had contemporary news editors existed back in the days when books were invented, they would have published big scary articles expounding on the dangers of reading a book while riding a horse or chopping firewood.
I’ve seen why people steal the foreground window for their dialog box
Now, it may very well be true that many people who use as the owner for a dialog box because they don't know any better, but I'm not convinced that everyone who does so did it out of ignorance; I'm sure there's some malice in there, too. Here's how it may have gone down: Bug: I start the product setup, and then I go and work on something else, and then setup hits a problem, but the error message can't be seen because it's hidden behind another window. Result: Setup fails to complete. Expected: Error dialog is visible so user can address the problem and allow setup to complete. The programmer who i...
Steamy coffee leaves grounds for concern
I'm embarrassed for the bad pun,¹ but the subject is serious. Two stories appeared in the two major local newspapers on the same day. Sure, it may have been a coincidence, but I considered it a cautionary tale. Follow-ups Baristas resign en masse when the coffee stand owner decides to adopt a provocative dress code. Over a year later, NPR picks up the story. Footnotes ¹I'm not embarrassed for making a pun, just that it's a bad pun. (Some people would argue that there's no such thing as a good pun.)
How can I tell that a directory is weird and should be excluded from the user interface?
Last time, we looked at a customer who wanted to know how to tell whether a given folder was a Recycle Bin folder or not. We answered the question as stated, but made the mistake of not looking at the problem the customer was trying to solve. I need to know which folders are Recycle Bin folders so I can skip over them when searching the drive for content. Ah, the real question isn't "How can I tell whether a directory is a Recycle Bin folder?" but rather "How can I tell whether a directory contains weird stuff that we shouldn't be showing to the user (of which Recycle Bin files are just one example)?" The...
How can I tell that a directory is really a recycle bin?
Here's a question inspired by an actual customer question: I need a function that, given a path, tells me whether it is a Recycle Bin folder. I tried using functions like SHGetSpecialFolderPath with CSIDL_BITBUCKET, but that doesn't work because the Recycle Bin is a virtual folder that is the union of the Recycle Bins of all drives. The customer noted that they don't want to hard-code the words RECYCLED and RECYCLER, which is a good decision because the name of the directory depends on many things. I mentioned earlier that it depends on the file system. It also depends on whether the drive is accessed local...
Well at least that’s one fewer program that relies on window handles being even numbers
Earlier this year I received a piece of email from a programmer at a major software firm, reprinted below (suitably redacted) with permission. It was a sort of a mea culpa. (Remember: no guessing allowed.) Hi, Raymond. I'm a dev on Product X and recently we were sitting around having a beer after work, discussing the long and sordid history of our code base, and an interesting factoid came up that you might be interested in. Apparently, when we were writing Version 1 of our program many years ago when buffalo roamed the earth, window handles were always even numbers for whatever reason. We relied...
The purpose of charts is normally to make information easier, not harder, to understand
In a presentation a few years ago, there was a pie chart, but not just any pie chart, but a pie chart that appeared to be specifically designed to convey no information whatsoever. (The presenter didn't realize this, of course, and probably thought it was awesomely cool.) The pie chart consisted of five wedges, each of which was a slightly different shade of green. No, wait, that's not right. Each wedge was a gradient from a common shade of green to a slightly different shade of green for each wedge. Accompanying the chart was a legend that described what each shade of green represented. It was completely usele...
I no longer have to remind the payroll department to gear up for annual raises
September 15 is the date on which annual raises take effect. This means that on the 15th, the payroll servers are swamped with people eyeballing their new paycheck breakdown to see what has changed. And every year, on September 15th, the servers would become overloaded and people would be unable to connect. Instead they'd get a message like this: Due to unexpectedly high demand, the payroll servers are unable to service your request. Please try again later. We apologize for the inconvenience. Unexpectedly high demand? This happens every year on exactly the same date! How could it be unexpect...
The terms of service you have to accept before you can see them
I had a few hours to kill at the airport a few years ago before my flight was ready for boarding, so I turned on my laptop and connected to the airport's wireless network. Like most pay services, they way you sign up is to fire up a web browser and go to any web site. Regardless of what site you go to, you are redirected to the "Here's how to buy a day's worth of wireless networking" site. So far so good. At the sign-up page, they asked for the usual information and also had a reminder that signing up for the service implies that you have read and accepted their terms of service. There was a link to their te...