The Old New Thing

Using accessibility to monitor windows as they come and go

Today's Little Program monitors windows as they come and go. When people contemplate doing this, they come up with ideas like installing a WH_CBT hook or a WH_SHELL hook, but one of the major problems with those types of hooks is that they are injected hooks. Injection is bad for a number of reasons. It forces the hook to be in a DLL so it ...

When will GetMessage return -1?

A source of great consternation is the mysterious return value from : If there is an error, the return value is −1. For example, the function fails if is an invalid window handle or is an invalid pointer. That paragraph has caused all sorts of havoc, because it throws into disarray the standard message pump: But don't worry, the ...

The x86 architecture is the weirdo: Structured exception handling

If your reference architecture is x86, then you will think that everything it does is normal and the rest of the world is weird. Except it's the other way around: The x86 architecture is the weirdo. I was reminded of this when commenter 640k complained, on the subject of what I think is table-based structured exception handling, "It would ...

Raymond’s highly scientific predictions for the 2013 NCAA men’s basketball tournament

Once again, it's time for Raymond to come up with an absurd, arbitrary criterion for filling out his NCAA bracket. This year, I look at the number of fans of the basketball team's official Facebook page, or one tenth of the number of fans of the school's athletic department, whichever is greater. The fraction 1/10 is completely arbitrary...

Microspeak: Science project

A science project is a feature that is really cool and challenging from a technological standpoint but is way overkill for the end-user scenario at hand. Back in the late 1990's, a bunch of us cooked up this idea for a networked screen saver that ran at night after most people had gone home from work. You told it the physical location and ...

It may be your birthday, but why stop at just the day? Think big!

I had the pleasure of meeting a friend of a friend who is an odd, quirky sort, in a wholly endearing sort of way. When her birthday comes around, she isn't satisfied to have just one day of celebration. Or even a week. No, she takes the entire month. The entire month of March is open season for taking her to dinner, getting her a gift, or ...