The Old New Thing

How can SIGINT be safely delivered on the main thread?

Commenter AnotherMatt wonders why Win32 console programs deliver console notifications on a different thread. Why doesn't it deliver them on the main thread? Actually, my question is the reverse. Why does unix deliver it on the main thread? It makes it nearly impossible to do anything of consequence inside the signal handler. The main ...

Why seventh grade students want to go to weddings

My friend the seventh-grade teacher is getting married this summer, and when her students learned about the impending nuptials, they couldn't contain their excitement. The students asked her if there was going to be a chocolate fountain. Because you can't not have a chocolate fountain. When they learned that, no, there will not be a ...

Simulating a drop, part two

Last time, we wrote a tiny program to simulate dropping a file on another file, but we discovered that it didn't work for dropping a file onto Mail Recipient.MAPIMail. The reason, as you no doubt instantly recognized, is that the MAPIMail handler creates a worker thread, and we're exiting the process before the worker thread has finished its ...

Reading a contract from the other side: Simulating a drop

Most people, when they think of the IDropTarget interface, think only of implementing a drop target. But you can read the contract from the other side, because the description of how a drag source interacts with a drop target tells you how to be a drag source. To summarize, the sequence of drop target operations go like this: IDropTarget...

Things other people have written that have amused me

I occasionally post things I've written that have amused other people, but today I'm going to share something Betsy Aoki wrote that amused me. On one of our internal mailing lists, somebody wondered why we don't use email spam filters to attack comment spam and trackback spam. My point was that the goal of email spam is very different from ...

Windows could not properly load the XYZ keyboard layout

In my rôle as the family technical support department, I get to poke around without really knowing what I'm doing and hope to stumble across a solution. Sometimes I succeed; sometimes I fail. Today, I'm documenting one of my successes in the hope that it might come in handy for you, the technical support department for your family. (...

A modest proposal: Getting people to stop buying SUVs

I developed this modest proposal many years ago, but it looks like rising gasoline prices have done the job. But in case they don't, here's my plan. SUVs are classified as "trucks" for the purpose of C.A.F.E. regulations, and those regulations are more lenient on gasoline efficiency for trucks. As a result, the auto industry happily built...