CSharpie CSharpie - 1 year ago 94
C# Question

Single-click to open an item (point to select)

Some users actually prefer to open/execute files on a single click and have configured their windows accordingly.

I need to access this information so i can mimic the behaviour in a custom ListBoxControl. However I havent got a clue where this setting could be stored.

Probably my english isnt good enough to search for the right term here. I suspect this to be accessable by wmi.

Answer Source

This value is stored in the registry in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellState at fifth byte.

You can check if single click is set with this:

var value = Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\", "ShellState", null) as byte[];
var singleClick = value != null && (value[4] & 32) == 0;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download