The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Why do program files go into the Program Files directory?
Some of Microsoft's software certification programs (such as the Windows Logo) require that applications set their default installation location to the Program Files directory. What is the reason for this? One technical reason is that this ensures that the directory receives an appropriate default security descriptor. But the Program Files directory was introduced in Windows 95, which didn't have security descriptors, so that can't be the entire reason. Rewind the clock to Windows 3.1. Microsoft didn't provide guidance on where applications should install by default. As a result, they went everywhere....
Why does Explorer ignore seconds when sorting by Date Modified?
A customer reported that Explorer appears to be ignoring the seconds when sorting by Date Modified. The customer was kind enough to include detailed steps to reproduce the problem. Start with a folder with several files, sorted by Date Modified. Right-click on the newest file, select Copy. Right-click on the blank column on the right, select Paste. This will create a file with the same name, but with "- Copy" appended. Press F5 to refresh the view and note the sort order. The copy appears at the top of the list. Highlight the newly-created file, hit F2, and give the document a different name, an...
Why doesn't the Maximize button maximize across all monitors?
Cheong wonders why there isn't a way for the Maximize button to maximize a window across multiple monitors. (Troll asks a similar question: Why doesn't Windows support spanned mode for multiple monitors?) We tried it that way at first. And we quickly discovered why it was a bad idea. Wait, I'm not finished yet. Things get still worse if your two monitors are not the same size. In that case, the virtual screen is larger than the visible region. For example, my monitor arrangement has a landscape monitor on the left and a portrait monitor on the right, with the bottoms of the monitors aligned. ...
This isn't Highlights magazine: Sort keys and why they change
Some time ago, Ry Jones gave some examples of Quotable Raymond, including the following: How to make a good doc bug report: 1. Don't embed pictures. ... This isn't Highlights magazine. What Ry didn't realize is that his "..." totally misrepresented the message. There were actually two separate items, but he combined them into one and replaced the missing parts with "...". I already ranted some time ago about embedding pictures. Today I'll rant about the second item, which is turning a bug report into the Spot the difference between these two pictures game in Highlights magazine. A customer reporte...
How do I make it so that users can copy static text on a dialog box to the clipboard easily?
Given that you have a Win32 dialog box with static text in an control, how do you make it so that users can easily copy that text to the clipboard? The traditional solution is to create a borderless read-only edit control (which draws as static text by default). Add it to the tab order by setting the style, and maybe even give it a keyboard accelerator for accessibility. Starting in Windows Vista, version 6 of the common controls provides an alternative. (A less accessible alternative, mind you.) Static text controls automatically copy their contents to the clipboard when you double-click them if you...
What was the nature of the feedback that resulted in the change to the highlighting model for Explorer navigation pane?
Gabe wanted to know the nature of the feedback that resulted in the change to Explorer navigation pane. Historically, Explorer had a navigation pane that contained a folder tree, and the navigation pane could be toggled on and off. From observations and usability studies, we observed that users in general found this toggling burdensome. People liked the folder tree as a form of browsing, but they didn't like the fact that the folder tree kept changing as they navigated through the system. In other words, they liked the fact that they could change the folder tree by expanding and collapsing nodes, but they wante...
How can I customize which notification icons are displayed by default on a new installation?
There's a setting for it, but you need some help from the application.
Why was HDS_FILTERBAR added to the common controls if nobody uses it?
Mike Dunn was curious about the intended purpose of . The style adds a row below the header control consisting of an edit control and a funnel icon. The funnel icon presumably represents a coffee filter, because after all, everybody in the world drinks coffee as much as people in Seattle. (Developers think they're so clever.) Mike points out that new features of the common controls were nearly always used by whatever version of Windows or Internet Explorer shipped that new version. The style is a notable exception. What happened? I believe the feature was originally intended for use by Active Directory; m...
Why does Windows keep showing the old indirect strings even after I update the binary?
If your application uses indirect localized string resources, and you update the application, you may find that Windows keeps using the old string from the previous version of the application. For example, suppose that you set the localized name for a shortcut to , and in version 1 of your program, you have For version 2, your marketing team decides that the program should really be called Contoso Document System, so you change the resource file to read The user upgrades to version 2 of your program, but the shortcut on the Start menu still reads Contoso Document Services. What's going on?...