• The Old New Thing

    Why isn't Fast User Switching enabled on domains?

    • 30 Comments

    Windows XP added a new feature called Fast User Switching which lets you switch between users without having to log off. But this feature is disabled if your computer is joined to a domain. Why?

    There were several reasons, none of them individually insurmountable, but they added up to quite a lot of work for something IT administrators weren't even sure they wanted. (See a previous entry on retraining costs.)

    • How do you show all the users on the domain in the Welcome screen? You certainly don't want a list with 10,000 names in it. (Scroll scroll scroll.)
    • How do you check whether a user has a password? In Windows XP, the Welcome screen merely tries to log you on with a blank password. If it works, then poof! you're in. If it doesn't work, then it displays the password prompt. This works, but it also generates a failed password event into your security event log. Many IT administrators have a passwork lockout policy, where if you get your password wrong more than N times, your account is locked. Blank password probing would result in locked-out accounts all over the company.

    Those of you who have gotten Longhorn can see that Fast User Switching is now enabled on domains. New infrastructure needed to be developed to enable the feature on domains without ruining the domain administrators' lives.

  • The Old New Thing

    What's the deal with the System Volume Information folder?

    • 53 Comments

    In the root of every drive is a folder called "System Volume Information". If your drive is NTFS, the permissions on the folder are set so not even administrators can get in there. What's the big secret?

    The folder contains information that casual interference could cause problems with proper system functioning. Here are some of the things kept in that folder. (This list is not comprehensive.)

    • System Restore points. You can disable System Restore from the "System" control panel.
    • Distributed Link Tracking Service databases for repairing your shortcuts and linked documents.
    • Content Indexing Service databases for fast file searches. This is also the source of the cidaemon.exe process: That is the content indexer itself, busy scanning your files and building its database so you can search for them quickly. (If you created a lot of data in a short time, the content indexer service gets all excited trying to index it.)
    • Information used by the Volume Snapshot Service (also known as "Volume Shadow Copy") so you can back up files on a live system.
    • Longhorn systems keep WinFS databases here.
  • The Old New Thing

    Notepad's geek options require Word Wrap be disabled

    • 13 Comments
    If you want to use the "Go To" or "Status Bar" options, you have to turn off word warp first. (Word wrap messes with line breaks.)
  • The Old New Thing

    How can I tell if I have the 64-bit edition of Windows?

    • 6 Comments

    Answer: Your wallet is empty.

    Seriously, there is no way you bought an Itanium by mistake. They are expensive machines: The entry-level workstation available from HP (who co-developed the Itanium with Intel) goes for over $3000 and the entry-level server is over $13,000. And in addition to paying for the computer itself, you probably had to install a custom air conditioning system for your building to keep it cool.

    If you still aren't sure whether you have one, go to Help.About in Explorer. At the top of the About box, it will say "Windows XP 64-Bit Edition" if you have it.

  • The Old New Thing

    Make sure the buttons match the question

    • 34 Comments

    When your program displays a dialog box with buttons, please make the buttons match the text. Consider this dialog, which appears after you install patches from Windows Update:

    It asks a yes/no question, but the options are "OK" and "Cancel". Either the buttons should be changed to "Yes" and "No", or the text of the message should be changed to match the OK/Cancel buttons. In the latter case, the text could go something like, "Windows Update will restart your computer. If you want to restart later, or close other programs first, click Cancel, and then restart your computer manually."

  • The Old New Thing

    Another favorite from the Grauniad

    • 18 Comments
    The world: a primer

    Great Britain

    Small American dependency located approximately 5,000 miles outside Galveston, Texas.
  • The Old New Thing

    More stories of bad hardware

    • 6 Comments

    My favorite bad CD-ROM drive from Windows 95 was one where the manufacturer cut a corner to save probably twenty-five cents.

    The specification for CD-ROM controllers indicates that each can host up to four CD-ROM drives. When you talk to the card, you specify which drive you wish to communicate with.

    The manufacturer of a certain brand of controller card decided that listening for the "Which drive?" was too much work, so they ignore the drive select and always return the status of drive 1. So when Windows 95 Plug and Play goes off to detect your CD-ROM drives, it finds four of them.

    Apparently this was a popular card because the question came up about once a week.

  • The Old New Thing

    Stay healthy: Drink Guinness

    • 4 Comments

    Flavenoids in Guinness combat fatty deposits in arteries. Note, however that the beer was consumed by being "fed ... via tubes directly into their stomachs."

    On the other hand, a friend of mine points out, "I thought a tube leading directly to the stomach was also called the esophagus. That's my Guinness delivery system."
  • The Old New Thing

    Preventing edit control text from being autoselected in a dialog box

    • 2 Comments

    By default, when the user TABs to an edit control in a dialog box, the entire contents of the edit control are autoselected. This occurs because the edit control responds with the DLGC_HASSETSEL flag in response to the WM_GETDLGCODE message. To prevent it from happening, remove that flag.

    LRESULT CALLBACK RemoveHasSetSelSubclassProc
        (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam,
         UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
    {
        switch (uiMsg) {
        case WM_NCDESTROY:
            RemoveWindowSubclass(hwnd, RemoveHasSetSelSubclassProc,
                                 uIdSubclass);
            break;
        case WM_GETDLGCODE:
            return DefSubclassProc(hwnd, uiMsg, wParam, lParam)
                                 & ~DLGC_HASSETSEL;
        }
        return DefSubclassProc(hwnd, uiMsg, wParam, lParam);
    }
    

    All this subclass procedure does is remove the DLGC_HASSETSEL flag from the return value of the WM_GETDLGCODE message.

    INT_PTR CALLBACK DlgProc(HWND hdlg, UINT uiMsg,
                             WPARAM wParam, LPARAM lParam)
    {
        switch (uiMsg) {
        case WM_INITDIALOG:
            SetWindowSubclass(GetDlgItem(hdlg, 100),
                              RemoveHasSetSelSubclassProc, 0, 0);
            break;
        case WM_COMMAND:
            switch (GET_WM_COMMAND_ID(wParam, lParam)) {
            case IDCANCEL:
                EndDialog(hdlg, 1);
                break;
            }
        }
        return FALSE;
    }
    

    The subclass procedure is installed when the dialog box is initialized.

    int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hinstPrev,
                       LPSTR lpCmdLine, int nShowCmd)
    {
        DialogBox(hinst, MAKEINTRESOURCE(1), NULL, DlgProc);
        return 0;
    }
    
    1 DIALOGEX DISCARDABLE  0, 0, 200,200
    STYLE DS_SHELLFONT | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
    CAPTION "sample"
    FONT 8, "MS Shell Dlg"
    BEGIN
      CONTROL         "Blah blah",100,"Edit",WS_TABSTOP,7,4,100,10
        DEFPUSHBUTTON "&Bye", IDCANCEL, 7,24,50,14, WS_TABSTOP
    END
    

    And here is the dialog box that we display.

    There really isn't much to it, but I figured a complete sample program might help somebody out. Plus it lets me show off the SetWindowSubclass function.
  • The Old New Thing

    British newspapers are much more fun to read

    • 14 Comments

    You can always count on The Register for a snarky take on the day's technology news. Today's favorite is this "review" of the nTAG, which ends with

    Well, we think that any sane person would have to held at gunpoint to induce them to carry an electronic device which, besides containing personal or other information which is transmitted wirelessly, can also be tracked by event organisers and makes the wearer look like a complete muppet. We could be wrong, of course.

    Even more mainstream papers like The Guardian can develop quite an attitude. They recently ridiculed the furore over that thing that everybody is talking about but the courts have forbidden the press from reporting on. My favorite is still this list of things we don't miss. I don't understand three quarters of it but I don't care; it's still a riot.

    Why are newspapers in the States so stodgy? The only wild goofiness in a major paper I can think of offhand is the Washington Post Style Invitational, but they wouldn't dare let any of this infect their "serious" news...

Page 377 of 390 (3,898 items) «375376377378379»