Painting only when your window is visible on the screen

Sometimes you want to perform an activity, such as updating a status window, only as long as the window is not covered by another window. The easiest way to determine this is by not actually trying to determine it. For example, here’s how the taskbar clock updates itself: It computes how much time will elapse…

6

Hardware backwards compatibility

Backwards compatibility applies not only to software. It also applies to hardware. And when hardware goes bad, the software usually takes the blame. The HLT instruction tells the CPU to shut itself down until the next hardware interrupt. This is a big win on laptops since it reduces power consumption and thereby saves your lap…

11

Why are these unwanted files/folders opening when I log on?

I get called on frequently to do troubleshooting, so I figure I’d share some entries from my private bag of tricks.  (And there are some remarks for programmers hidden here too.) Problem 1. A folder like C:\Program Files\LitWare opens each time you log on. Reason: Your system contains two sibling directories where one is a…

5

What are all these files in my C:WINDOWSCSC directory?

This is where Windows keeps the files that you have marked for being available offline.  (CSC was the working name for the feature now called Offline Files. It stands for Client-Side Caching.)

12

What are those little overlay icons?

Windows XP ships with a number of icon overlays. A small arrow. Everybody knows this one: It’s the shortcut overlay. A hand, palm up. This is the “sharing” overlay. A folder with this overlay is the root of a file share. A downward-pointing blue arrow. This is the “to be written to CD” overlay. A…

3

Rotating the Z-order

Sometimes you run into a conflict where you need the controls laid out in one Z-order to get hit-testing to work, but need a different order to get keyboard TAB order working. For example, consider this dialog template, which has been simplified for expository purposes. //////////////////////////////////////////////////////////////////////// // // Note: The ListView control has to be…

1

Windows brings out the Rorschach test in everyone

It seems that no matter what you do, somebody will get offended. Every Windows 95 box has an anti-piracy hologram on the side. The photographer chose his infant son as his model, since the human face is very hard to copy accurately. The baby sits next to a computer, and as you turn the hologram,…

10

Knitting a pumpkin

I’ve decided to change the color scheme to match my latest knitting project:  A pumpkin hat. (Previous food-themed hats were raspberry and eggplant.) I just got a call from the yarn store that the yarn for my sweater has come in, and I can’t wait.

3

Why isn’t my time zone highlighted on the world map?

In the original release of Windows 95, you could change your time zone by clicking on the map, and the time zone you selected would highlight. Similarly, you could change your Region Settings by clicking on the world map. This was one of those little touches that made Windows 95 that much more fun to…

35

The secret life of GetWindowText

GetWindowText() is more complicated than you think. The documentation tries to explain its complexity with small words, which is great if you don’t understand long words, but it also means that you’re not getting the full story. Here’s an attempt to give the full story. How windows manage their text There are two ways window…

3