The Old New Thing

Changing the Windows boot logo

This is the answer I give to IT people when they ask if it’s okay to customize the Windows boot logo.
If you hack the bitmap everything will seem fine until six months down the road when you decide to install the latest service pack.

Answer to previous exercise

If you look at the WM_VSCROLL message, you’ll see that the scroll position is a 16-bit
value. So if the number of entries is more then 65535, you won’t be able to use the
scroll thumb to get to the ones at the end.

Scrollbars, part 4: Adding a proportional scrollbar

To obtain a proportional scrollbar, you need to tell Windows the minimum and maximum
values covered by the scrollbar, the current scrollbar position, and the size of the
scrollbar thumb (called the “page size”). One annoyance of the way scrollbars are
set up is that the maximum value is attainable.

Answer to yesterday's exercise

iMin is the lowest-index element which intersects the paint rectangle, so a
simple truncating division produces the desired index.

The formula for iMax can be interpreted two ways. One is that it is the roundup
of the first invisible line. Recall the rectangles are exclusive of the endpoint,

Why doesn't the new Start menu use Intellimenus in the All Programs list?

Common request:
I want to be able to turn on personalized menus (Intellimenus) when in XP Start Menu mode.
Imagine if Intellimenus were enabled with the XP Start Menu.
You use 5 apps; the rest are not used much. (Studies show that 5 is the typical number of unique applications users run on a regular basis.

Scrollbars, part 3: Optimizing the paint cycle

Observe that we paint all 100 lines in our paint handler, even though most of them
aren’t visible. This is a problem if there are a large number of items, or if painting
an item is time-consuming.

So instead, we optimize our paint cycle so as to paint only the elements which intersect
the paint rectangle.

Why doesn't Windows have an "expert mode"?

We often get requests like this:
There should be a slider bar somewhere, say on the Performance Tab, that ranges from Novice to Advanced. At the highest level, all the geek settings are turned on. At the Novice level, all the settings for beginners are turned on.

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.

Old New Thing

Why does the Alpha AXP predict a coroutine transfer the way it does?

Working out the possibilities.

The case of the Uuid­Create­Sequential that didn’t use the MAC address

If you want to use it, make sure it's good.

The Magical Excel 97 Far East Language Build Screwdriver™

For your magical build needs.

I set the same ACL with the GUI and with icacls, yet the results are different

Sometimes your tools lie to you.

My summer vacation: The London Eye

Round and round. We'll, really just round. No "and round".

Why does my single-threaded program have multiple threads?

They're not your threads, but they're in your process.

Can the MTA thread exit while keeping its COM class registrations alive?

You can keep the MTA alive without having to dedicate a thread.

Not even getting to the airtight hatchway: Planting files in world-writable directories

But who uses that world-writable directory?

How can I copy or move a group of files into a new folder from Explorer?

Putting together things you already have.

The curious pattern of pre-emptively rejecting the solution to your problem: Redrawing during resizing

You'll have to invalidate it, either the easy way or the hard way.