The Old New Thing

Scrollbars, part 2

Managing scrollbars is not hard in principle. The basic idea is not that difficult,
but there are a lot of small details that need to be ironed out. If you don’t get
the details just right, your program will feel odd in a strange way that you often
can’t pinpoint,

More terse Q&A on Tweak UI 2.10

I’m going to try to alternate between programming entries (where I actually try to teach something) and random entries (where I get to spout off or go into storytelling mode). So here’s another random entry.

Why does Tweak UI put up a totally incomprehensible error message (“Cannot locate entrypoint GetDllDirectoryW in Kernel32.dll”) when I try to run it on an unsupported OS?

The scratch program

Occasionally, there is need to illustrate a point with a full program. To avoid reproducing the boring parts of the program, let’s agree on using the following template for our sample programs.
For expository purposes, I won’t use a C++ class.

Tweak UI 2.10

What are you talking about?
Tweak UI is part of the Windows XP PowerToys. It was recently updated to version 2.10.
What OS is required?
Windows XP Service Pack 1 (or higher) or Windows Server 2003 (all versions). Not supported: Windows XP RTM,

Old New Thing

How can I turn a structured exception into a C++ exception without having to use /EHa, if I can constrain exactly where the structured exception is coming from?

Trying to contain the damage.

How can I handle both structured exceptions and C++ exceptions potentially coming from the same source?

Call for a translator.

Why can’t I use SHSetKnownFolderPath to change the location of FOLDERID_LocalAppData?

A acknowledgement of the reality that it not only doesn't work, but leaves the user profile corrupted.

The historical significance of the Burgermaster drive-in restaurant

You can just phone it in.

It’s not a security vulnerability that users can access files that they have access to, even if the file is a little hard to find

Perhaps it's behind a sign that says Beware of the Leopard.

Over-documenting TTM_RELAYEVENT and why it results in a one-second periodic timer running as long as the tooltip is visible

Too much information leads to trouble.

Tree-walking algorithms: Incrementally performing an inorder walk of a binary tree

We need to keep track of where we came from.

Tree-walking algorithms: Incrementally performing a postorder walk of an N-ary tree

This time, we report on the way back up.

Tree-walking algorithms: Incrementally performing a preorder walk of an N-ary tree

Remembering whether you were moving down or up.

Tree-walking algorithms: Incrementally enumerating leaf nodes of an N-ary tree

Stop to rest when you turn.