The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Email tip: Choose a subject line that is meaningful to the recipient, not to the sender
Presumably you want the recipient to read the message. That's why you sent it. It would behoove you to select a subject line which conveys to your reader the purpose of your message. Otherwise your reader is likely to ignore it for being too vague and uninteresting. Here are some actual bad subject lines I've seen. Suppose your Inbox had a hundred messages that all looked like this. Would you bother reading even one of them? I'm sure the subject line makes perfect sense to the person who sent the message. They have only one customer with a question, so "Question from my customer" captures the issue perfectly...
Iced-over roads + people who can't drive = very expensive (and dangerous) game of billiards
Unbelievable video of people in Portland, OR who should know better trying to drive down an icy road. (Direct WMV link. Interview with the person who shot the video, but you're going to have to put up with the inane local news-anchor chatter. That last link includes images of cars that, yup, struck the fire truck.) It's as if these people had lost control of all rational thought. When your car slowly skids to a halt after crashing into a half dozen stopped cars and other roadside obstacles, your brain should be telling you, "Boy, that was a really stupid idea. I should stop now before I kill myself or a pedest...
Should all windows appear in the taskbar?
No new content today, just some follow-up discussion on the topic of windows that don't appear in the taskbar. The rules for which windows appear in the taskbar have been documented in MSDN for years, so changing the rules now would mean doing so after the game has ended. Consequently, this is not the sort of change that can be made lightly. First point is that the taskbar is called the "taskbar" and not something like the "open windows bar". The name already suggests that the purpose is to display tasks, not open windows. I find it interesting that people, in their zeal to turn the taskbar into a "windows ba...
One Armstrong = 13.5 mph
Out of curiosity, I wanted to know how fast Tour de France riders go up l'Alpe D'Huez, the legendary mountain climb. Using information from the Wikipedia page, I calculated that Lance Armstrong's 2004 ascent had an average speed of approximately 13.5 mph (22 kph). Consequently, I invented the Armstrong, a unit of bicycle velocity, with one Armstrong equal to 13.5 mph. (If I were being fair, I would have used 1 Pantani = 14mph, since Marco Pantani holds the record for the fastest ascent of l'Alpe d'Huez. But I'm not being fair.) The day after I made this fantastic calculation, I glanced down ...
EnumChildWindows already enumerates recursively
I often see people write code that goes something like this: The intent here was to perform the operation on all the windows in a window tree by operating on the root, then operating on each of the children. Operating on the children is in turn performed recursively, so that we eventually see every window in the tree. Except that if you actually run this function on a vaguely interesting window tree, you'll find that items get counted multiple times. The reason is that the function already does the recursion: If a child window has created child windows of its own, EnumChildWindows enumerates those wind...
The wisdom of sev^H^H^Heighth graders: It was not just white people who were helped by Martin Luther King
(Today is the birthday of the famed civil rights leader, the first time since 2001 that the federal holiday coincides with the correct historical date. It seemed an auspicious date to return to the time machine essay.) The eighth grade students were given the same in-class writing assignment as the seventh graders, with the same ground rules, I took two days off from work to help read those essays like I did with the seventh grade essays. (What can I say. I volunteer for strange things.) When I started reading the essays, I immediately noticed the difference one year makes in the quality of writing. The eigh...
Does Microsoft internally use MFC for writing Windows apps?
Craig Ward figures that if he asks enough questions I might answer one of them. "Does Microsoft internally use MFC for writing Windows apps? How about VB?" People use whatever they decide best meets the requirements for the task at hand. That could be a batch file, a C++ program, a perl script, a web page with a bunch of JScript, use your imagination. Is the number of solutions that use MFC and VB nonzero? I don't know for sure (I'm not in the habit of taking all the programs I see and trying to figure out what language they're written in), but I'd be very surprised if somebody somewhere hasn't thrown together a...
How do I print the contents of a rich text control?
For some reason, people are really puzzled by rich edit printing. I'm no expert on printing, but even I was able to figure it out. The kernel is the message. Each time you call it, a little bit more of the rich text control is printed, and the message returns the index of the first unprinted character, which you can pass back in to print the next chunk. The rest is just setting up and tearing down. We start by getting the dimensions of the page and telling the rich edit control what we intend to render to by using the message. Next, we need to fill out our , which we do by specifying the we are rendering...
The history of the RichEdit control from Murray Sargent
Murray Sargent is a programmer over in the Office division whose blog deals mostly with math in Office, but he also slips into RichEdit history. If you can't get enough of a history fix from this web site, you can surf on over to Murray's for another hit.