How do I read the "Double-click to open an item (single-click to select)" setting in Folder Options?


Today's Little Program reports whether the Double-click to open an item (single-click to select) option is selected in the Folder Options dialog. A customer wanted to know how to do this, presumably so that their program would respect the setting and adjust its user interface to match.

#include <windows.h>
#include <shlobj.h>
#include <stdio.h>

BOOL IsDoubleClickToOpenEnabled()
{
 SHELLFLAGSTATE sfs;
 SHGetSettings(&sfs, SSF_DOUBLECLICKINWEBVIEW);
 return sfs.fDoubleClickInWebView;
}

int __cdecl main(int, char**)
{
 printf("Double-click is %s\n",
        IsDoubleClickToOpenEnabled() ? "enabled" : "disabled");
 return 0;
}

The flag and member name is kind of weird. The ability to single-click to open an item was introduced as part of the Windows Desktop Update which came with Internet Explorer 4. This update made Explorer more Web-like, with single-click to activate and underlines appearing on hover. (This was back in the day when making everything more Web-like was the new hotness.)

The internal name of this Explorer feature was WebView, and that name is reflected in the flag and structure.

Comments (21)
  1. skSdnW says:

    I'm surprised Explorer still gives you the option to enable this mode and it is even on the first tab in the options dialog. It was fun for a couple of minutes back in '97 but I could never get used to it and always ended up launching something when I only wanted to select. Does the Explorer telemetry actually indicate that a lot of people switch to this mode?

    I just don't understand the Explorer team. The treeview has broken/non-existent horizontal scrolling and the "Show all folders" and "Automatically expand to current folder" settings don't work for certain special system folders but this single click feature is so important that it cannot be scrapped?

    [Yes, there are people using this setting. (Indeed, today's article was motivated by a customer who asked how to check the setting.) But the more important point is that these sort of legacy features tend to hang around until they start causing problems. A legacy feature that isn't causing any problems doesn't draw attention. It's not like every product cycle, the complete list of features is put up on the wall and people discuss whether each feature deserves to live another day. (Can you imagine how long that meeting would be?) -Raymond]
  2. Jeffrey Bosboom says:

    "It's not like every product cycle, the complete list of features is put up on the wall and people discuss whether each feature deserves to live another day. -Raymond"

    "…not when there is nothing more to add, but when there is nothing left to take away."  (Though I agree such a meeting would be impossible.)

  3. SimonRev says:

    The cynic in me wants to say that your customer really wanted to know how to change the setting, but knew you would make an example in your blog if he asked that question.  Instead he asked how to get the setting, and assumed he could figure out how to set the setting from that answer.

  4. alegr1 says:

    >The treeview has broken/non-existent horizontal scrolling

    Not the worst thing. The worst thing is that the focus for keyboard commands randomly goes to the tree, and then, instead of deleting the selected files, you end up deleting some folder (which may be different from the one shown in the right pane). This is what you get when you rewrite the software using cheap offshore coders.

  5. Joshua says:

    > "…not when there is nothing more to add, but when there is nothing left to take away."

    smr.c

  6. SvenG says:

    "I'm surprised Explorer still gives you the option to enable this mode and it is even on the first tab in the options dialog."

    I'm glad it does, because I'm one of the people who uses it. As someone who's rather RSI-prone, I find the reduction in clicks to be worth it, and you get used to it very quickly.

  7. skSdnW says:

    @Raymond: "It's not like every product cycle, the complete list of features is put up on the wall and people discuss whether each feature deserves to live another day."

    But for Win7 this had to be done because Explorer switched from a ComCtl32 ListView to a custom Direct UI window so the Explorer team must have felt that the feature was important enough to re-implement in the new control.

    [Presumably. -Raymond]
  8. foo says:

    @SimonRev: I'm guessing SHGetSettings is just a wrapper around SHGetSetSettings(lpss,dwMask,FALSE). But real programmers Google for which registry setting(s) to change.

  9. cheong00 says:

    Btw, if somehow the Windows codebase become so large that, the automated Unit Tests cannot complete within a day, wouldn't it make sense to take away a few giant features that few people is using? (i.e.: Had a feature making unit test / compile time too long but with too little use got removed just because of that?)

  10. alegr1 says:

    @cheong00:

    Through 3 service packs, Microsoft didn't have balls to remove the most annoying features of XP (search puppy, desktop cleanup), which could have been done with a different initial registry setting.

  11. The double click feature always seemed really dangerous to me. Accidentally started items when I wanted to select them etc. Feels a bit like those touchpads that move the mouse and also act as push buttons.

    Off topic:

    Has the cut/paste over bug in Explorer ever been fixed? I have a certain folder structure that I often cut/paste over an older version. Whenever I do this Explorer fails to copy four of its subdirectories. Replicably.

    Or could there maybe even be a hidden reason for this behaviour?

  12. Yarving says:

    A.. How to get these head files?

    #include <windows.h>

    #include <shlobj.h>

    #include <stdio.h>

  13. aylivex says:

    I love single-click since Windows 98, and one of the first things I do on a new OS is I switch selection mode to single-click and underlines on hover.

    And it's good to know how to make your software to follow the shell setting.

  14. alegr1 says:

    @Georg Rottensteiner:

    What's special about those 4 folders? Could their pathname length (source or destination) exceed the limit? Are there any non-default ACLs on them? Any non-ASCII characters in the names?

  15. xpclient says:

    What was a surprise for me in 2001 was that Web View could still be brought back in Windows XP!!  :) : support.microsoft.com/…/819028

    @skSdnW, many Windows users can never figure out when to double click and when to single click so it's an "easy" option for them to make everything single click. I have seen people double click to launch items from the Quick Launch or the Windows 7 Taskbar, and also some people trying to double click the Start button!!

    In Windows Vista, another interesting change was made. When the option "Use check boxes to select items" is enabled, point-to-select no longer works while in single click mode. This makes sense obviously, you must click on the checkbox to select the item but you can still use single-click to open without triggering accidental file selections by hovering. And if you hold down Ctrl, single click won't open even if you click the file name. So it's good to see these choices are being preserved.

    I am of the opinion that longstanding, legacy features should not only just hang around till they start causing problems. They should be proactively fixed if they break or start causing problems, but not pulled. Windows releases which followed this rule have been enormously successful.

    Unfortunately, when Explorer changed from ComCtl32 ListView to DirectUI, many features weren't implemented some of which are listed here (en.wikipedia.org/…/List_of_features_removed_in_Windows_7) which resulted in a degraded, unsatisfactory Windows 7 experience for XP Professional fanboys like me.

  16. alegr1 says:

    F6 historically has the same function as Ctrl+Tab. In Windows 7 Explorer, same as before, it toggles between all panes (and headers and toolbars), which are now too many.

  17. Nico says:

    @mh: I've engrained ALT+D into muscle memory for giving the address bar focus, which works in both most (all?) web browsers as well as Explorer.  You might give that a try (hopefully it's next in line for the guillotine).  It's also a bit easier to hit from the home row.

  18. Nico says:

    > hopefully it's _NOT_ next in line for the guillotine

    Oops :)

  19. mh says:

    F6 to go straight to the address bar in Windows Explorer, with the current path highlighted and ready to be replaced by whatever you type, was the only one that really caused me difficulty.  Oddly, it still works in *Internet* Explorer (and most other browsers) but not in *Windows* Explorer, which cost me some investment in muscle memory.

  20. Yuhong Bao says:

    "many Windows users can never figure out when to double click and when to single click so it's an "easy" option for them to make everything single click. I have seen people double click to launch items from the Quick Launch or the Windows 7 Taskbar, and also some people trying to double click the Start button!!"

    The worst is double-clicking the Office 2007 Office button which will cause the window to close.

  21. @alegr1: They are normal folders inside others. They are not the longest of them all. I've read about the same bug from a few other users. It seems to happen with a bunch of folders/files when the "Do you overwrite or skip"-dialog is used.

Comments are closed.

Skip to main content