October, 2006

  • The Old New Thing

    How do I shut down a workstation via Remote Desktop?


    When you are connected to a workstation via Remote Desktop, the "Turn Off Computer" option changes to "Disconnect". But what if you really want to turn off the computer, hibernate it, or put it on stand-by?

    Note: These tips work on Windows XP, but there is no guarantee that they will work in future versions of Windows.

    One way to do this is to run Task Manager and select your shutdown option from the "Shut Down" menu.

    Another trick is to click on the desktop and type Alt+F4. This will call up the shutdown dialog, where you get the usual shutdown options like "Shut down", "Shut down without installing updates", "Restart", "Stand by", and "Hibernate".

    These next two tricks are documented and will continue to work in future versions of Windows:

    If you're a command line person, you can run shutdown.exe, but that program supports only shutdown and restart; it doesn't do stand-by or hibernate. But the shutdown.exe program has a serious flaw: It requires you to have administrator privileges. If you are a limited user with shutdown privileges, the shutdown.exe program will complain. (Which means that I don't use it.)

    Finally, if your computer isn't using Fast User Switching, you can type the Ctrl+Alt+End hotkey, which is the Remote Desktop version of Ctrl+Alt+Del and consequently takes you to a dialog where you can do various system-type things, among them logging off and shutting down.

  • The Old New Thing

    The great Polish Sea -or- We forgot Poland!


    Open up the Date and Time control panel and go to the Time Zones tab. Notice anything wrong with the world map? Take a close look at northern Europe.

    Depending on what version of Windows you have, you might see a body of water where Poland should be. Windows 95 didn't have this problem, but Windows 2000 did. And whether your copy of Windows XP has this problem depends on precisely what version you have.

    Where did the great Polish Sea come from?

    This weekend marks the end of Summer Time in Europe, and the answer has to do with time zones.

    Recall that the Windows 95 control panel highlighted your current time zone on the map. To accomplish this, each time zone was assigned a different label in the time zone bitmap. To draw the map, the portions of the world whose label was the same as the selected time zone were drawn in bright green, and the parts that were different were drawn in dark green. So far so good.

    When the highlighting on the time zone map had to be disabled, all that happened was that the "color for the selected time zone" was set to dark green. The code still went through the motions of drawing the time zone in a "different" color, but since the colors were the same at the end of the day, the visual effect was that the highlighting was removed.

    To determine which parts of the world are land and which parts are sea, the time zone map enumerated all the time zones as well as the labels associated with each time zone. (You can see them in the registry under "MapID".) In this way, the land masses of the world gradually emerged from the ocean as the time zones claimed each spot of land one by one.

    The shell team did make one fatal mistake, however, obvious in retrospect: It assumed that the world's time zones would never change. But what happens when a country changes its time zone, as Poland did? At the time Windows 95 was released, Poland was on its own custom time zone, which Windows 95 called "Warsaw Standard Time/Warsaw Daylight Time", but it didn't stay that way for long. Just within Windows 95 and Windows 98, Poland's time zone went by the following names:

    • Windows 95: (GMT+01:00) Warsaw
    • Windows 95: (GMT+01:00) Lisbon, Warsaw
    • Windows 98: (GMT+01:00) Bratislava, Budapest, Ljubljana, Prague, Warsaw
    • Windows 98: (GMT+01:00) Sarajevo, Skopje, Sofija, Warsaw, Zagreb

    And that's not counting the changes that were made in Windows NT, Windows 2000 or Windows XP or their service packs. It's not that Poland's time zone actually changed that many times. Rather, the way it was grouped with its neighbors changed. I don't know why all these changes were made, but I suspect political issues played a major role.

    As a result of all this realignment, the "Warsaw Standard Time" time zone disappeared, and with it, its associated land mass. Consequently, the land corresponding to Poland remained underwater. And for some reason, nobody brought this problem to the attention of the shell team until a couple years ago.

    In order to fix this, a new world bitmap needed to be made with new labels (labeling the pixels corresponding to Poland as "Central European Time") so that Poland would once again emerge from the sea. Even though the highlighting is gone, the map code still needs to know where every time zone is so it can raise them from the ocean floor.

    Fortunately, all this will soon fall into the mists of history, because Windows Vista has a completely rewritten time zone control panel, so the mistakes of the past can finally be shed. Let's hope the people who wrote the new time zone control panel remembered Poland.

  • The Old New Thing

    Does a dual-core processor count as one or two for licensing purposes?


    Now that dual-core processors are gaining in popularity, there has been some confusion over whether a dual-core processor counts as one or two. This discussion of multicore processor licensing may clear things up. The short answer is that a dual-core processor still counts as one processor.

    For example, Windows XP Professional supports up to two processors. If you have two dual-core processors, Windows XP will use them both, for a total of four processing units. And if you enable hyperthreading on those processors, you get eight virtual processors out of the deal! Similarly, Windows XP Home supports one processor, but you if your one processor is a dual-core processor, then it will use both cores.

    Now, I'm not so lucky as to actually have a dual-core machine, so I'm just taking it on faith that the linked article is correct. I haven't been able to run experiments to confirm.

  • The Old New Thing

    Why does Windows hide keyboard accelerators and focus rectangles by default?


    The release of Windows 2000 introduced a new setting: "Hide underlined letters for keyboard navigation until I press the Alt key," which defaults on for most Western languages. What's the story behind this setting?

    I still have the rationale from the user interface designer who introduced this feature. Here's a redacted copy:

    To support our goal of greater simplicity, we plan to suppress keyboard navigation indicators by default. Don't be frightened...

    The idea is to reduce visual noise in Windows, namely focus indicators and access key underlines in menus and windows. Aesthetically, these things are distracting and intimidating. Functionally, they're only useful when you're navigating by keyboard. They don't add significant value when you're just using the mouse. In fact, they're often redundant.

    Why now? Every good thing must start somewhere. Windows will look cleaner and simpler.

    What's so bad about the way things are? Access key underlines are largely underutilized and are often redundant with Ctrl+ shortcuts within the same menu. There's no indication that you have to type the Alt key to use these shortcuts. Plus, it's just odd to see characters underlined within text all over your display. Focus rectangles lack graphic integrity, and they're often redundant with the highlight on selected items or the default button.

    Of course, the keyboard indicators will come back when there is any demonstration of keyboard navigation by the user. The indicators will appear and disappear appropriately. Finally, if you don't like the behavior at all, you can disable it from the Display control panel.

    For what it's worth, this is one of the things I [the interface designer] came to Microsoft to fix.

    An additional point not mentioned in the original rationale is that with the rise of the web browser as the primary use of a computer, users have increasingly been conditioned to treat underlined text as "Click me" rather than "Use me in conjunction with the Alt key to activate this item".

    The thing about seeing randomly-underlined letters all over the screen is a point many technically-inclined people miss. To a typical user, all these indicators scream "Entering a propeller-head zone!" and "You are not smart enough to use this computer."

    What does frustrate me about this setting, though, is not its design but its implementation. Using the arrow keys to navigate a pop-up menu doesn't appear to count as a "demonstration of keyboard navigation by the user", which is particularly frustrating since you can't use the Alt key to make that demonstration, for the Alt key dismisses the menu! To see what the keyboard accelerators are for a pop-up menu, you have to find a way to cause the menu to pop up based on a keyboard action (usually hitting Shift+F10 when focus is on the appropriate element). This is often harder than it sounds.

  • The Old New Thing

    Non-resolution of the dead home desktop problem


    Last time, I told of attempting to upgrade my home computer and failing. I ultimately gave up and returned the parts to the store, telling them that I thought the IDE controller on the motherboard was dead. They refunded my money after a false step where they refunded me more than I paid for the components in the first place! (I bought the motherboard and CPU as a bundle, but the person who rang up the return treated them as two separate items and ended up refunding me the full price instead of the bundled price. It's one thing to return a defective product and get your money back. But to turn a profit doing so is downright wrong.)

    Thus bereft of computer equipment, I drove down to the local Fry's and bought a bottom-of-the-line computer which would merely serve as a shell for all my working equipment. I would be using the motherboard, CPU, memory, and case from the computer, but I didn't care for the other stuff since I would be performing an "instant upgrade" with the old computer's DVD drive and hard drives. It cost about $60 more than the parts I bought from the failed upgrade attempt, but the saved grief was well worth it.

    Skipping ahead in the story: After I got the machine up and running, I plugged one of my old hard drives into the machine and... the BIOS recognized it, and the volume mounted just fine.

    On the other hand, I can't access the files on the drive yet. I don't have a domain at home (I'm not that big of a geek), so my SID on the new computer is different from my SID on the old computer. My new account can't access files created by the old account. I would have to do some SID history magic to get access to the files protected by my old SID, but I'm just going to take the lazy way out and do a recursive "replace ACLs" on all the files on the old hard drives. (This requires multiple passes, though. First I have to take ownership, then I can change the ACLs after I become the owner.)

    Now about that new computer. It comes with Windows XP Media Center Edition, even though the video card doesn't have a DVI connector. I was kind of baffled by this. If you're going to run Media Center Edition, doesn't that mean you're highly likely to hook it up to some awesome flat-panel display for watching your videos? I don't quite understand why this bottom-of-the-line computer with an analog-only video card bothered to install Media Center Edition. Who are they fooling?

    Okay, so I'm going to have to upgrade the video card, too. That increases the cost delta over the parts to around $160. Still worth it though.

    One of the odd features of the new computer is that it has a 9-in-1 multi card reader built into the front panel. This is a cute feature, but it is also frustrating since it gobbles up four drive letters.

    But that's okay. I already described how you can fix this when I talked about the infinitely recursive directory tree. I created a directory called C:\CARDS and inside it created directories C:\CARDS\CF, C:\CARDS\SD, and so on. I then used the Disk Management snap-in to de-assign drive letters from each of those card readers and instead mounted each card reader into the corresponding folder I had created. Now I can access the contents of the CF reader by going to C:\CARDS\CF.

    One thing that really frustrates me about off-the-shelf computers is all the shovelware that comes with them. I fire up the computer and my notification area is filled with useless icons I don't want to see again, with more stupid programs jammed themselves into the Run key. No, I don't need an AOL monitor running. No, I don't need QuickTime pre-loaded. No, I don't need a program to monitor my card readers and do some evil icon chicanery.

    The evil icon chicanery is particularly gruesome because every time I log on, I get a dialog box that looks like this:


    Good job there, stupid evil icon program. I bet you assume the user is an administrator.

    The computer also came with a recovery partition. I hate those too.

    Today's status is that I'm not out of the woods yet. I have a working computer, I can mount my old hard drives (though it'll take work to get access to the files), I still have to upgrade the optical drive to the rewritable DVD drive that I had in the old computer. I still have to get rid of all the shovelware that came with the system. I still have to reinstall the drivers for my rewritable DVD drive and printer. (I'm sure I have that CD around here somewhere.) And I still have to get a new video card that supports digital output so I can use an LCD panel.

    Some improvements:

    • USB 2.0 ports. (My old computer had only 1.0.)
    • The fans shut off in standby mode. (My old computer left the fans running, which negated much of the benefit of standby mode.)
    • "Shut down and restart" actually works. (For some reason, my old computer was incapable of restarting.)
    • The new computer is a lot quieter.
  • The Old New Thing

    No good deed goes unpunished, part 2


    Sometimes you're better off keeping your fool mouth shut.

    When I reply to a question on an internal discussion list, often with a clarifying question rather than an answer, it will occasionally happen that the person I replied to will send a response directly to me rather than including the discussion list. This is bad for a few reasons.

    • I was just trying to help you ask a better question. I didn't sign up to be responsible for the answer. I have an actual job whose description does not include "Solving your personal problems."
    • Sending the response directly to me means that others on the discussion list miss out on the answer. (Assuming I even know the answer.) It also prevents the answer from going into the discussion list archives.
    • Sending the response directly to me means that if I happen to go on vacation or am otherwise unavailable, you won't get an answer to your question. Other people on the discussion list can't chip in with their advice since you didn't include them on the reply.
    • Sending the response directly to me creates an implied obligation on me to reply. I didn't sign up for that.

    When somebody does this, I typically forward the message back to the discussion list with a message like "I wish they'd fix that Exchange Server bug where the discussion list keeps getting deleted from the 'To' line." This is a little joke that I use to avoid directly accusing the person of removing the discussion list from the 'To' line intentionally.

    I used to write some variation of "It's that annoying Outlook bug again..." but Jensen Harris asked me to stop because they were actually getting bug reports filed into the Outlook defect tracking database that went, "Outlook is deleting discussion lists from the To line when people reply. Raymond says so, so it must be true." The poor Outlook folks had to keep explaining to the people who submitted these bug reports, "No, Raymond was making a joke (at your expense)." To take the heat off the Outlook team, I switched to blaming Exchange Server. I have no idea if the Exchange Server team has their own collection of analogous bugs. They haven't asked me to change my joke, so maybe it's not a problem for them.

  • The Old New Thing

    What does the letter "T" in LPTSTR stand for?


    The "T" in LPTSTR comes from the "T" in TCHAR. I don't know for certain, but it seems pretty likely that it stands for "text". By comparison, the "W" in WCHAR probably comes from the C language standard, where it stands for "wide".

  • The Old New Thing

    Why do I see the same fake names in Microsoft samples over and over?


    If you see a fake name in a Microsoft sample web site, sample code, or sample documentation, you'll probably find that it's usually one from a small set of names. A sample corporation is typically called Contoso or Fabrikam. A sample store is typically Wingtip Toys. (For a few weeks, they used Wingtip Toys on Windows Live Local.) A sample bank is Woodgrove Bank. And a sample software company is Litware, Inc. (There are other fake names, but these are the ones you're most likely to see.)

    Where did these fake names come from?

    The Trademark Group in Microsoft's legal department.

    The Trademark Group performed background checks on these names and cleared them for use as fictitious entities by Microsoft samples and documentation. The web sites for all of these "companies" redirect to the main Microsoft home page. Having a pool of "standard fake names" means that Microsoft samples and documentation don't run into the problem of a fake URL turning into a porn site.

  • The Old New Thing

    640 x 480 is still not dead


    Windows still has to worry about displays running at 640×480 resolution. Even though the default minimum resolution was bumped up to 800×600 for Windows XP, there are still 640×480 devices out there, typically tiny monitors on servers. One common set-up is to have a bank of tiny little monitors, each corresponding to one server in a cluster, with one large monitor that can "tap into" any of the tiny monitors for a closer look. Even though these servers typically are managed via remote administration, keeping actual monitors available acts as a safety net when remote administration proves insufficient, for example, if there is a networking problem.

    I don't know what the minimum video requirements will be for Vista, but I doubt they'll really affect these types of machines. These server monitors are not interested in any fancy new video features like Aero Glass or desktop composition.

    Running at 640×480 is not just for these server monitors, though. I believe Safe Mode runs at 640×480, so Explorer still needs to be usable at that resolution. This has design consequences, for it means that every component of the interface that a user might need when in Safe Mode (such as the Start menu, Explorer windows, Add or Remove Programs, possibly Windows Update I'm not sure) needs to remain usable under such low resolutions. For the Start menu, for example, this means making sure that the default Start menu will still fit on the screen even at 640×480.

    You might respond, "Well, that's stupid, letting this 640×480 limitation cramp your design. You should design for a high-resolution display, say something that is 1024×768 or greater, and have a special 'Safe Mode' version of the interface that runs in 640×480 for the cases where you have to squeeze into a smaller space."

    This approach has two drawbacks. First, it means that there are two versions of the user interface that have to be designed, implemented, and tested. The amount of work is disproportional to the benefit, since Safe Mode is used less than one tenth of one percent of the time (and that's probably grossly over-estimating). If you were in a position to decide where user interface resources should be spent, would you spend it on a special Safe Mode interface, or would you rather spend it on making the Aero interface even more solid?

    The second problem with a special Safe Mode interface is that, well, it's a special Safe Mode interface. When the user boots into Safe Mode, they're already anxious. Their computer doesn't work; they're trying to fix it. And then they boot up and are faced with a new interface that they're not familiar with. This doesn't do much to calm their anxiety.

  • The Old New Thing

    Invalidating the null window redux


    The people who work on the next generation of the window manager, known as the Desktop Window Manager (DWM), told me that their original plan was to get rid of the compatibility hack that says that invalidating the null window invalidates the entire desktop, but by an amazing coincidence, two days after I posted that article, they received a report that the beta version of an upcoming product from a major vendor still relies on that behavior (albeit accidentally). They contacted the vendor who agreed to fix the bug, but the fact that a modern program still relies on this ancient behavior gave them pause. If a program written just this year relies on the null window hack, imagine how many programs written in years past also rely on that behavior. After some deliberation, they decided to put the compatibility hack back in, just to be safe.

    Some compatibility hacks never die, no matter how hard you try to kill them.

Page 1 of 4 (36 items) 1234