我认为资源管理器不会在 Vista/Windows 7 中加载列处理程序。
要在 vista 文件对话框中更改视图设置:
Check OS version (needs Vista or higher)
Not sure which event is raised on startup, OnFolderChange maybe?
assuming OnFolderChange is raised, override CFileDialog::OnFolderChange:
call GetIFileSaveDialog/GetIFileOpenDialog to get IFileDialog
//begin undocumented behavior
QI for IServiceProvider from IFileDialog
QS for SID_SFolderView with IID_IFolderView2
call IFolderView2::SetViewModeAndIconSize
//end undocumented behavior
clean up COM interfaces
或者,您可以尝试未记录的方法 #2
//begin undocumented behavior
QI for IServiceProvider from IFileDialog
QS for SID_STopLevelBrowser with IID_IShellBrowser
call IShellBrowser::QueryActiveShellView to get IShellView
QI IFolderView2 from IShellView
call IFolderView2::SetViewModeAndIconSize
//end undocumented behavior
clean up COM interfaces