July, 2013

  • The Old New Thing

    Why does Explorer sometimes show my server name in parentheses?

    • 27 Comments

    A customer wanted to know why Explorer showed one of their servers in the folder list the normal way:

    ⊞ servername

    but another server showed up "where the server name is parentheses and the node name is in front."

    ⊞ nodename (servername)

    "Where is Explorer getting that information, and why are the two servers showing up in different ways?"

    It's all in the server comment.

    From the command line, you can view the server comment by typing net view \\servername. For example,

    Shared resources at \\servername
    
    Printer server next to the third floor bathroom
    
    Share name  Type  Used as  Comment
    
    ----------------------------------
    ...
    

    You can set the comment with the command line

    net config server /srvcomment:"Printer server next to the third floor bathroom"
    

    If a server has a comment, then the comment is shown to the user on the expectation that the comment is something that is more meaningful to the user than some cryptic server name. Microsoft's own server names are hyper-cryptic, like TK5EX14MBXW603. Of course if you talk to a support technician, they'll tell you that the name is clear as day. "The TK means that the server is physically in our Tukwila data center. The 5 means that..." (I never manage to stay awake long enough to learn what the 5 stands for.)

    I guess this created more confusion than clarification, because the comment-name-followed-by-parenthesized-server-name convention appears no longer to be in use starting in Windows Vista.

    Communications breakdown: When we provided this information back to the customer, the customer liaison simply replied back, "Thanks, we figured that out on our own."

    That was not a very clear reply. Is the customer liaison saying, "That's the information we were looking for, thanks. We managed to figure that out on our own in the meantime." Or maybe the customer liaison was trying to say "Thanks for the information, but we already knew that. We were looking for something else."

    I asked the customer liaison whether they needed any more information from us, and there was no reply. I guess that's passive-aggressive way of saying, "No."

  • The Old New Thing

    Sometimes people can be so helpless: Finding the owner of a Web page

    • 13 Comments

    Internal to Microsoft are thousands of Web sites. This is a story about one of them.

    On an internal discussion list, somebody asked

    We just created a new Flurb. Does anyone know how to get listed on http://internalsite/newflurbs?

    I hadn't heard of that site before, but I checked it out. Neat, it's basically a blog which announces new Flurbs. I can see how somebody would want their Flurb to be listed there. I also saw lots of pieces of information on the page which the person appears not to have noticed. I replied,

    Um, how about the Email link in the navigation bar? Or did you try that and it didn't work?

    Also, each entry has the same name at the bottom. You could try contacting that person.

    Just giving you some ideas on problem-solving techniques.

    Pre-emptive snarky comment: "Hey, Raymond, where's your contact link?" I was forced to disable the contact link some time ago because it was being used primarily to send spam. Finding my email address is left as an exercise. (It's not hard.)

  • The Old New Thing

    I'm sure that Star Trek-themed parties exist, so why has no one ever scheduled one as a Microsoft holiday party?

    • 5 Comments

    I dreamed that I was attending a Star Trek-themed company party. Nobody was dressed as a Starfleet officer or anything exotic. Half of the people ignored the party theme and came in cocktail attire, and half were dressed in Renaissance or Elizabethan clothes, but they represented Star Trek aliens because they were not all white Europeans, and some of them had funny hair. And because we were told that it was a Star Trek-themed party, and in dreams you don't question this sort of thing.

    I recognized some of the aliens as staff members from the previous Star Trek-themed party and concluded that most of the aliens were ringers that were included in the party package. (Note: This detail means that in my dreams, I have now attended not one but two professionally-staged Star Trek-themed parties. In real life? None.)

    When the dinner portion of the party began, the attendees split up into groups. About half of them went into a banquet room where I heard the emcee welcome guests from a local non-profit organization, another local non-profit organization, and a major bank. I had clearly gone the wrong way and was steered to another part of the event facility where the Microsoft people were gathered. The staff member apologized for putting us so far away from the main hall.

    I followed the signs through the facility and as I neared the location, we were offered very sharp pointed bread sticks, elegant hand towels with enigmatic messages like On my way there, a small flat object made of pressed straw that purported to be some sort of chair, and a ceramic object shaped like a small anvil that identified itself as a grill.

    I was told that my wife was already at "the gutter." I pulled out my cell phone to call her, to discover that it wasn't mine but rather belonged to one of my colleagues, with whom I had chatted during the cocktail hour. How I ended up with his phone (and presumably he with mine) was never explained.

    As I got close to the dinner location, I saw the line of people waiting to go in. I never did learn what "the gutter" was, but my guess based on the clues so far was that we were all sitting on the curb or on the ground like hoboes.

  • The Old New Thing

    A program for my nieces: The ABCs, part 4

    • 11 Comments

    Disabling autorepeat in my ABC program was largely sufficient to keep my nieces happy, given their instructions to press only one key at a time. Once in a while, though, they would hit the context menu key in the bottom right corner of the keyboard, and then they'd get stuck because they didn't know how to dismiss it.

    So let's disable that key outright.

    LRESULT CALLBACK EditSubclassProc(
        HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
        UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
    {
      switch (uMsg) {
      case WM_NCDESTROY:
        RemoveWindowSubclass(hwnd, EditSubclassProc, uIdSubclass);
        break;
      case WM_CHAR:
        if ((lParam & 0x40000000) && wParam != VK_BACK) return 0;
        break;
      case WM_CONTEXTMENU:
        return 0;
      }
        return DefSubclassProc(hwnd, uMsg, wParam, lParam);
    }
    

    Well, that was awfully anticlimactic, wasn't it.

  • The Old New Thing

    From Microsoft's mail room to the board room

    • 14 Comments

    In the early 1980's, Microsoft moved its headquarters from downtown Bellevue to Northup Way in Bellevue, a building which later served as a training center (Microsoft University) and is now the North Campus of Bellevue Community College. This is the building in which the infamous Bill Gates Tiger Beat-style photo was taken, and the one I told a story about some years ago.

    At the time, the company was still very small, and the task of managing the relocation was shared among all the employees. After everybody settled in at the new building, it became apparent that the mail volume was barely a trickle. In particular, checks were not coming in, which is kind of an important part of running a business.

    In the excitement of moving, nobody remembered to file a Change of Address form with the Post Office. A visit to the old Bellevue offices revealed a huge mound of mail at the old location.

    A Change of Address was quickly filed, but in the meantime, Steve Ballmer became the company mailman. Every day, he would drive to the old offices, pick up the mail that had accumulated, dump it in the trunk of his car, then deliver it to the Northup offices.

    (Today's story is in recognition of the 238th birthday of the United States Postal Service.)

  • The Old New Thing

    What is the default cursor for a thread?

    • 21 Comments

    When we looked at the process by which the cursor is set, we neglected to discuss the case where nobody bothers to set the cursor. What is the ultimate default cursor?

    Let's write a program that refuses to set the cursor. Take the scratch program and add these lines:

    BOOL OnSetCursor(HWND hwnd, HWND hwndCursor,
                     UINT codeHitTest, UINT msg)
    {
      return TRUE;
    }
    
       HANDLE_MSG(hwnd, WM_SETCURSOR, OnSetCursor);
    

    What we did was make the window explicitly refuse to set the cursor by making it do nothing and return TRUE, which means, "It's all good. I set the cursor!" (Liar, liar, pants on fire.)

    Run this program, move the cursor over the window, and what do you get?

    The hourglass.

    Now, this is clearly some sort of pathological case, where there is a thread that covers its ears and hums whenever the window manager asks it to specify a cursor. But you can end up in this case unintentionally, and in fact there's a good chance that you've seen it happen. Just write an application that blocks the UI thread during startup. Take a fresh scratch program and add a different line of code:

            ShowWindow(hwnd, nShowCmd);
    
            Sleep(5000);
    
            while (GetMessage(&msg, NULL, 0, 0)) {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
    

    Here, we're simulating a program that hangs its UI thread during initialization. During that initial five-second delay, the program has yet to pump any messages, so it hasn't yet received the WM_MOUSE­MOVE or WM_NC­MOUSE­MOVE message that would normally trigger the WM_SET­CURSOR message. All the window manager can do is show the default cursor.

    That's why the default cursor is an hourglass.

  • The Old New Thing

    Nighttime pictures of London and Tokyo

    • 10 Comments

    Some eye candy for you: Stunning pictures of London from above at night, more of London from above at night.

    Tokyo at night, though from ground level, one of a series of photo walks.

  • The Old New Thing

    Windows 7 no longer tries to guess application size and other information

    • 34 Comments

    Back in the old days, if an application did not provide information like its Estimated Size or Install Date, then the Add/Remove Programs control panel tried to guess the values by searching your hard drives for files and directories that bore a superficial resemblance to the application. (Note that I use the word drives in the plural. It actually searched all of your drives, because some applications may have been installed to secondary drives. I can imagine the bug report that led to this extended search. "I installed LitWare 2000 to my D: drive, and the Add/Remove Programs control panel shows no information for it. You should have found it on my D: drive, because (like many power users) I install all my applications to my D drive to maintain free space on my C drive.")

    Time passed, and the name of the Add/Remove Programs control panel changed several times. It became Add or Remove Programs in Windows XP, changing the slash to the word or. In Windows Vista, its name changed to Programs and Features, but at least the name has been stable since then.

    In Windows 7, the "search your hard drive looking for the application" fallback algorithm was removed. If an application did not provide information such as its estimated size or install location, then Windows now just says, "Well, tough on you." My guess is that the search was removed because the vast majority of applications now provide the information directly, so the extra cost of trying to hunt it down for the last few application was not worth the benefit.

    There is still one tiny thing that Windows will guess: The installation date. But it doesn't have go hunting through your hard drive to guess that. It merely infers it from the last-modified date on the uninstall metadata itself!

  • The Old New Thing

    Office Office Office Malkovich Office Office Office

    • 13 Comments

    Some years ago, a colleague of mine received a message from our IT department. It began like this:

    You are receiving this notification because our records show that the machines below are still running a pre-release version of Office 2010. All pre-release versions of Office 2010 will expire on Office 31, 2010.

    Either the Office team managed to name a month after themselves, or the IT department had a bit too much Office on their mind.

  • The Old New Thing

    At least it's clear who will NOT be bunking together

    • 4 Comments

    I dreamed that I was on a business trip with two colleagues. We discussed Canadian science broadcaster David Suzuki and how in photos of him as a teenager, he looked like Elvis Presley. (Note: Not actually true as far as I know. Remember, this is a dream.)

    Fortunately, the hotel room we booked had three beds. But if Michael Jackson hadn't canceled, then two of us would have had to double-up, and we briefly discussed who would be bunking together. Possibly my two colleagues together, or me with the first colleague, or me with the second colleague. It went without saying, however, that had Michael Jackson actually shown up, he would definitely have been be given his own bed.

Page 1 of 3 (30 items) 123