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

Using the TAB key to navigate in non-dialogs

The IsDialogMessage function works even if you aren’t a dialog. As long as your child windows have the WS_TABSTOP and/or WS_GROUP styles, they can be navigated as if they were part of a dialog box. One caveat is that IsDialogMessage will send DM_GETDEFID and DM_SETDEFID messages to your window, which are message numbers WM_USER and…

4

What is the Alt+Tab order?

What determines the order in which icons appear in the Alt+Tab list? The icons appear in the same order as the window Z-order. When you switch to a window, then it comes to the top of the Z-order. If you minimize a window, it goes to the bottom of the Z-order. The Alt+Esc hotkey (gosh,…

23

The more I learn about Sweden, the weirder it gets

It must be really boring in Sweden in the winter. Things to do: Speed across the snow at 70kph by strapping a paraglider engine to your back. Eat rancid herring and call it a delicacy. (Fourth story.) Defend the northern border against invasion. Military service in Sweden is compulsory for all males. When your country…

10

Curling anyone?

The Granite Curling Club is having their annual open house today, October 18th 2003, from 2pm to 8pm. The Seattle facility is the only dedicated curling facility in the United States west of the Rockies. Bring sweatpants, flat-soled shoes, and $5. They’ll provide the brooms and duct tape. I became fascinated with curling many years…

9

Don't let Marketing mess with your slides

It’s PDC season, so I thought I’d relate an anecdote about a conference from many years ago. I forget which conference it was, maybe GCDC 1996, we were all busy preparing our presentations and submitted them to the Microsoft conference representatives so they could apply the standard template, clean them up, print out copies to…

5

Scrollbars redux: Part 12

Reader Jeff Miller added Word-style scroll tips to our sample scrollbar program. Here’s how he did it: HWND g_hwndTT; /* tooltip control */ TOOLINFO g_ti; /* tooltip info struct */ BOOL g_fInScroll; /* Scroll state */ void CancelScrollTip() { if (g_fInScroll) { g_fInScroll = FALSE; SendMessage(g_hwndTT, TTM_TRACKACTIVATE, FALSE, (LPARAM)&g_ti); } } void UpdateScrollTip() { if…


The much-misunderstood "nop" action

Last month, the printers were reconfigured in our building and we got an announcement that went like this: Subject: Printer/Copier Reconfiguration Microsoft Digital Campus Program Action Required blah blah blah printers are being reconfigured blah blah blah Action(s) to be taken: No action is required as the print path information will remain the same. Sometimes…

6