Windows – Vista/Win7 Listview “View Slider”

listviewwinapiwindows 7windows-vista

In Vista and Windows 7 almost any time the system uses a standard Listview (ie: Explorer Windows) it's accompanied by a little split button that shows a slider when the split is clicked that allows you to switch between the different views available for that listview (Tile, Details, List, etc.) as well as sliding smoothly between icon sizes (from 32×32 is to 256×256) using the top half of the slider.

This is a cool little bit of functionality, so I was wondering: Is that control available to developers, and if so what is it called and where is it documented? (Win32/C++ preferred)

Best Answer

Turns out in Windows 7, the explorer window is no longer a standard listview (though it does an extremely good job of looking like one). Open Spy++, point it at an explorer window list pane, and you'll see a classname of "DirectUIHWND" instead of the old "SysListView32".

The actual slider itself is indeed a real ComCtl32 slider; so you could perhaps roll your own; but as far as I know there's no way to reuse the existing explorer pane's functionality.