The Old New Thing

This Game Boy won’t hurt a bit, just help the Powerpuff Girls count backwards from ten

Is there nothing a Game Boy can't do? We already learned that it can be played like a musical instrument. Now we discover that letting children play with a Game Boy before surgery is more effective than tranquilizers or a parent's hand at keeping them calm. You know when you go to the dentist and she asks you, "What flavor fluoride rinse ...

The hunt for a faster syscall trap

The performance of the syscall trap gets a lot of attention. I was reminded of a meeting that took place between Intel and Microsoft over fifteen years ago. (Sadly, I was not myself at this meeting, so the story is second-hand.) Since Microsoft is one of Intel's biggest customers, their representatives often visit Microsoft to show off ...

Why do dialog editors start assigning control IDs with 100?

When you use a dialog editor and insert new controls, they typically are assigned control IDs starting at around 100. Why? Because the small numbers are already taken. /* * Dialog Box Command IDs */ #define IDOK 1 #define IDCANCEL 2 #define IDABORT 3 #define IDRETRY 4 #define IDIGNORE...

Scientists come one step closer to the perfect poppy-seed bagel

It's easy to distribute points evenly across a flat surface, but doing so over a curved surface is a much more complicated problem. Even spheres are hard. NPR's Scott Simon interviews mathematician Ed Saff who with colleague Doug Hardin has developed a new method of attacking this complex problem. Press release from Vanderbilt University...

Tintin goes to the neurologist

The Canadian Medical Association Journal traditionally runs an offbeat research paper in their Christmas edition, for which there is apparently huge competition. This year, Tintin goes to the neurologist. The feedback is fun to read too. (External news coverage here and here.) My first exposure to Tintin was—of course—in ...

For all your chicken sequencing needs

The International Chicken Sequencing Consortium announced that it has completed the sequencing of chicken DNA. I repeat: There is an organization called "The International Chicken Sequencing Consortium". (For some reason I want to think these people get together and decide, "Okay, Ginger goes first, then Bunty, then Babs...

Dragging a shell object, part 5: Making somebody else do the heavy lifting

Creating that drag image was a bit of work. Fortunately, the listview control is willing to do some of the work for you. Throw away the OnLButtonDown function (and the HANDLE_MESSAGE that goes with it). Instead, we'll make the listview do all our presentation for us. BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpcs) { g_hwndChild = ...

Time to dust off your conspiracy theories

When I started studying Swedish, my web searches happened to alight upon Francis Strand's blog thanks to its wonderful title, "How to learn Swedish in 1000 difficult lessons", and I've been following his musings on life on Stockholm ever since. Wednesday morning, an apartment just a block away from his own exploded under curious ...

Dragging a shell object, part 4: Adding a prettier drag icon

You may have noticed that the drag feedback is rather sad-looking. Just a box, maybe with a plus sign or an arrow; you don't even know what it is you're dragging. Let's fix that. We'll drag the icon of the file around. We'll need to add the drag image to the data object. void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT...