Question

I`m using an IShellView instance with the FVM_AUTO (-1) flag as view mode. That means the explorer should choose a viewstyle that fits the content of the displayed folder. This works fine except the fact, that columnheaders are visible for viewstyle other than Details, e.g. Thumbnails.

The IShellView object and view window is created like this:

ShellFolder1.CreateViewObject(this.Handle, 
                              ref IID_IShellView, 
                              out shellViewObject));
IShellView shellView = shellViewObject as IShellView;
FolderSetting folderSettings = new FolderSetting();
folderSettings.ViewMode = (int)View; // view is FVM_AUTO = -1
folderSetting.FolderFlags = FolderFlags.NoClientEdge
                            | FolderFlags.ExtendedTiles
                            | FolderFlags.AutoArrange
                            // only columnheaders for view mode details
                            | FolderFlags.NoHeaderInAllViews;
shellView.CreateViewWindow(oldView, ref folderSettings, isb, 
                            ref rect, ref m_ShellViewHandle);

A list of available folder flags can be found here: http://msdn.microsoft.com/en-us/library/bb762508(VS.85).aspx

Any suggestions how to tell the view that column headers should be displayed only for "details" in auto view mode? setting FolderFlags.NoColumnHeader does not change anything.

Thanks

Was it helpful?

Solution

this behavior seems to be a bug and is reported on MS connect

Additional information from MS support:
The folder controls the view. The values you pass to CreateViewWindow are merely suggestions. For the most part, these suggestions are respected, but a folder is technically allowed to ignore them.

In particular, this case overrides the suggestion for compatibility with Windows XP. If you use IShellView3::CreateViewWindow3, then this compatibility behavior does not apply, and the flags should be respected better. You can use the SV3CVW3_FORCEFOLDERFLAGS flag to make your suggestion more emphatic.

--> use IShellView3.CreateViewObject3 with the ForceFolderFlags flag

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top