The Old New Thing

Destroying the module and resource information associated with an icon

We've seen that icons and cursors know where they came from, and the window manager uses this information when you ask it to change the size of an icon. But not all icons carry this information, only icons created by passing a HINSTANCE and a resource name. You can use this to your advantage if you want to destroy the module and resource ...

Why does Explorer generate a page fault every two seconds?

If you fire up Task Manager and look at the page fault count, you'll see that even when nothing is going on, Explorer takes a page fault every two seconds. Isn't this bad? I though you weren't supposed to poll. Here's an interesting experiment: Change your update speed to High. Wow, the page fault rate quadruples to a page fault every half ...

Icons and cursors know where they came from

If you create an icon by calling , the window manager loads the specified icon from the module you specified, but it also remembers where the icon came from. (This discussion also applies, mutatis mutandis to cursors, but I will just talk about icons to avoid awkardness.) When you pass the flag to the function, the window manager goes back ...

It’s not Christmas: Nobody enjoys unwrapping your present

I don't know why it happens, but it happens with disturbing frequency. A customer wants to report a problem, and then illustrate it with a screenshot or two, but instead of attaching the screenshots, they paste the screenshots inside a Word document (and for some reason it's always Word) and then attach the Word document. It's not a ...

As a courtesy to performers and other audience members, please turn off blinking head-mounted devices

When a theater or concert performance begins, there is often an announcement asking audience members to silence their cell phones and similar devices. Some time ago, a light blinked near the ear of a gentleman a few rows in front of me throughout the entire performance. I couldn't tell what it was for sure, but it appeared to be the indicator...

The Seattle Danskin Women’s Triathlon 2008

This Sunday will be the Nth annual Seattle Danskin Women's Triathlon (for some value of N greater than 1), the largest women-only triathlon. I learned about this event last year when I saw that the express lanes on the I-90 bridge were crowded with bicyclists, and I went online to try to figure out what was going on. As I clicked around, I ...

The implementation of iterators in C# and its consequences (part 4)

You can breathe a sigh of relief. Our long national nightmare is over: this is the end of CLR Week 2008. We wind down with a look back at iterators. Michael Entin points out that you can use C# iterators to make asynchronous code easier to write. You can use C# iterators for more than simply iterating. The automatic ...