Showing results for October 2003 - The Old New Thing

Oct 31, 2003
0
1

Why highlighting by inverting colors is a bad idea

Raymond Chen
Raymond Chen

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. ...

Code
Oct 30, 2003
0
0

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

Raymond Chen
Raymond Chen

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 g...

History
Oct 29, 2003
0
0

Drawing an active-looking caption even when not active

Raymond Chen
Raymond Chen

"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 of ...

Code
Oct 28, 2003
0
0

When vendors insult themselves

Raymond Chen
Raymond Chen

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. ...

History
Oct 27, 2003
0
0

Getting a custom right-click menu for the caption icon

Raymond Chen
Raymond Chen

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. When we receive a message, we check that...

Code
Oct 26, 2003
0
0

Being the Nobel Peace Prize

Raymond Chen
Raymond Chen

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 ...

Non-Computer
Oct 25, 2003
0
0

Kinder Überraschungen

Raymond Chen
Raymond Chen

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. Whenever I go to Germany I smuggle some Kinder Überraschungen into the States. (Yes, t...

Non-Computer
Oct 24, 2003
0
0

Why Daylight Savings Time is nonintuitive

Raymond Chen
Raymond Chen

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.

HistoryTime
Oct 23, 2003
0
0

Writing a sort comparison function

Raymond Chen
Raymond Chen

When you are writing a sort comparison function (say, to be passed to or *gasp* to be used as an ), your comparison function needs to follow these rules: Reflexivity: . Anti-Symmetry: has the opposite sign of , where 0 is considered to be its own opposite. Transitivity: If and , then . Here are some logical consequences of these rules (all ...

Code
Oct 22, 2003
0
1

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

Raymond Chen
Raymond Chen

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:    the ".asm" extension on "foo" is...

History