自定义 Windows 保存对话框不再奇特 - 为什么?
根据这个问题,我正在使用自定义模板描述自定义Win32“保存文件”对话框。现在我遇到一个问题,“保存文件”对话框不显示我的计算机的左侧栏、最近的位置等。我可以确认删除自定义模板会恢复左侧栏。我做了什么值得将其删除的事情?我如何同时获得两者?
更新:以下是我的一些代码:
info.hInstance = MyGetModuleInstanceRoutine();
info.lpfnHook = MyOFNHookProcRoutine;
info.lpTemplateName = MAKEINTRESOURCEW(myCustomResourceID);
info.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_NOREADONLYRETURN |
OFN_ENABLESIZING | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLETEMPLATE;
::GetSaveFileNameW(&info);
注释:
MyOFNHookProcRoutine
始终返回 0。- 我知道扩展标志
OFN_EX_NOPLACESBAR
,但它不是设置(即FlagsEx
为 0)。
In accordance with this question I am customizing a Win32 Save File dialog with a custom template description. Now I have a problem where the Save File dialog doesn't show the left-hand bar with my computer, recent places, etc. I can confirm that removing the custom template brings the left-hand sidebar back. What am I doing that warrants its removal? How do I get both?
Update: Here's some of the code I have:
info.hInstance = MyGetModuleInstanceRoutine();
info.lpfnHook = MyOFNHookProcRoutine;
info.lpTemplateName = MAKEINTRESOURCEW(myCustomResourceID);
info.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_NOREADONLYRETURN |
OFN_ENABLESIZING | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLETEMPLATE;
::GetSaveFileNameW(&info);
Notes:
MyOFNHookProcRoutine
always returns 0.- I am aware of the extended flag
OFN_EX_NOPLACESBAR
and it is not set (i.e.FlagsEx
is 0).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加到 RED SOFT ADAIR-StefanWoe 的答案:
将 WINVER 和 _WIN32_WINNT 设置为 >= 0x0500 的值。
Windows 2000 中 OPENFILENAME 结构的大小有所增加,额外的空间包括 FlagsEx 成员;显然,如果结构太小而无法容纳标志
OFN_EX_NOPLACESBAR
,Windows 就会采用该标志。确保lStructSize
成员也设置正确。Adding to the answer from RED SOFT ADAIR-StefanWoe:
Set WINVER and _WIN32_WINNT to a value >= 0x0500.
The size of the OPENFILENAME structure grew for Windows 2000, and the extra space includes the FlagsEx member; apparently Windows assumes the flag
OFN_EX_NOPLACESBAR
if the structure is too small to contain it. Make sure thelStructSize
member is set correctly too.尝试使用
之前
意外地为我解决了同样的问题。
Try using
before
That accidentally solved the same problem for me.