Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 3085

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

$
0
0

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.


Viewing all articles
Browse latest Browse all 3085

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>