Why highlighting by inverting colors is a bad idea

Often people will say, “Oh, we can highlight by inverting the color.” This may have worked great on two-color black-and-white displays, but in the world of 32-bit color this no longer is effective. Consider the following picture. See if you can guess which one is inverted.     One Two Answer: The one on the…

14

I thought you said people don’t know how to read analog clocks

I had mentioned in passing in a comment on 10/10/2003 10:07PM that one of the reasons the clock on the taskbar isn’t analog is that some disturbingly high percentage of people (30%? 40%? I forget exactly) do not know how to read an analog clock. Yet there is is in the Longhorn sidebar. What gives?…

19

Drawing an active-looking caption even when not active

“Why would somebody ever want to do that?” you might ask. Well, this is a common appearance for floating toolbars. (But aside from that case, I can’t think of any other valid reason to draw a window as active even though it isn’t.) Fortunately this is easy to do. Just add this line to the…

20

When vendors insult themselves

During Windows 95, when we were building the Plug and Play infrastructure, we got an angry letter from a hardware vendor (who shall remain nameless) complaining that we intentionally misspelled their company name in our INF files in a manner that made their company name similar to an insulting word. This is of course a…

14

Getting a custom right-click menu for the caption icon

Explorer does it. Now you can too. It’s a simple matter of detecting a context menu on the caption icon and displaying a custom context menu. Here are the simple changes to our scratch program to display a rather pointless one-item menu. // Add to WndProc case WM_CONTEXTMENU: if (lParam != -1 && SendMessage(hwnd, WM_NCHITTEST,…

2

Being the Nobel Peace Prize

For Hallowe’en this year, I’m going to be the Nobel Peace Prize. (I like being things that people would never even think of as a possible Hallowe’en costume. Last year, I was an inter-office envelope. People addressed me from place to place.) I chose the Nobel Peace Prize in part because I’m studying Swedish so…

12

Kinder Überraschungen

Laura John entertains her colleagues with Kinder Surprise eggs. I love these things. I understand that Kinder Surprise eggs are illegal in the US for two reasons. Small parts. But that can be fixed by labelling the egg as “for ages 3 and up”. The FDA has a rule banning “inedible material completely enclosed by…

14

Why Daylight Savings Time is nonintuitive

Welcome Knowledge Base article 932955 readers! Remember, the information on this Web site is not official Microsoft documentation. Daylight Savings Time ends this weekend in most of North America and Europe, so it seems a good time to discuss the whole problem of Daylight Savings Time and timestamps. A common complaint is that all the…

32

Writing a sort comparison function

When you are writing a sort comparison function (say, to be passed to ListView_SortItems or *gasp* to be used as an IComparer), your comparison function needs to follow these rules: Reflexivity: Compare(a, a) = 0. Anti-Symmetry: Compare(a, b) has the opposite sign of Compare(b, a), where 0 is considered to be its own opposite. Transitivity:…

8

What’s the deal with those reserved filenames like NUL and CON?

Set the wayback machine to DOS 1.0. DOS 1.0 didn’t support subdirectories, lowercase, or filenames longer than 8.3. When you ran the assembler (or compiler if you were really fancy) the conversation went something like this: A>asm foo    the “.asm” extension on “foo” is implied Assembler version blah blah blah Source file: FOO.ASM Listing…

22