c++ - 在 Windows 7 中显示 XP 风格的 CFileDialog

标签 c++ visual-c++ mfc

我想在 Windows 7 中显示 CFileDialog,如下图所示。

desired dialog

根据 msdn

if OFN_ENABLETEMPLATE is set and OFN_EXPLORER flag is not set, the system uses the template to create an old-style dialog box that replaces the default dialog box.

但即使在这样做之后,我得到的也是这样的。 The one I get

请帮忙!

最佳答案

试试这个:

CFileDialog fd(1,0,0,0,0,0,0,FALSE);
fd.m_ofn.lStructSize = sizeof(OPENFILENAME_NT4);
fd.DoModal();

CTOR 的最后一个参数指定 Vista-style 为 false,sizeof 的结构大小用于反射(reflect) NT4 文件对话框。

关于c++ - 在 Windows 7 中显示 XP 风格的 CFileDialog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6856141/

相关文章:

c++ - 与服务器的连接已终止 - C++

c++ - 编译时如何使用外部模板参数

c++ - 使用不同的编译器 (C++) 生成的二进制文件速度差异太大

c++ - BoundsChecker 显示不正确的内存泄漏消息

c++ - 父窗口重绘时子窗口消失

c++ - 在 CStringArray 中从 5 个元素中选择 3 个元素?

c++ - Arduino/c++ 在另一个类中使用 SoftwareSerial 类

c++ - 使用integer_sequence 专门化模板。海湾合作委员会 vs MSVC

c++ - 命名空间中常量结构、类和数组的初始化

c++ - 如何制作同步对象的字典?