MFC 控件隐藏在 Windows 7 基本主题上
谁能告诉我为什么 MFC 应用程序在 Windows 7 基本主题中无法正确显示?
编辑:有人能猜出这个问题吗?
编辑:
- 我使用 vs2008 (相同版本用于创建此应用程序)。
- 这个特定的窗口是基于 DLL 的。为了创建该 DLL,我在 Stdafx.h 中添加了这些
。
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
- 此问题仅出现在该窗口中。
- 这个窗口是基于CDialog的,在OnInitDialog()里面我正在做这些,
。
CDialog::OnInitDialog();
AfxInitRichEdit();
// And Create three more child windows.
- 这就是它在基本主题中的显示方式。
但是,当我更改为 Windows Aero 主题时,它运行良好。
解决办法应该是什么?
编辑:请问有人吗?
Can anyone please tell me why MFC applications are not displaying correctly in Windows 7 basic theme ?
EDIT: Is there anyone who can guess the problem ?
EDIT:
- Im using vs2008 (same version is used to create this app).
- This particular window is DLL based.For creating that DLL I added these in the Stdafx.h
.
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
- This problem occurs only in this window.
- This window is based on CDialog, inside OnInitDialog() I'm doing these,
.
CDialog::OnInitDialog();
AfxInitRichEdit();
// And Create three more child windows.
- This is how it displayed in basic theme.
But, it is working nicely when I changed to Windows Aero theme.
What should be the solution ?
EDIT: Anyone please ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请检查一下。
Please check this.
我遇到了同样的问题,并通过谷歌引导到这里,但没有一个答案解决了问题。然后我仅通过将窗口/控件的
transparent
属性更改为 FALSE 来修复它。你能尝试一下吗?I got the same problem and led down here by google, but none of the answers solved the problem. Then I fixed it only by changing the
transparent
attribute of the window/controls to FALSE. Can you try it out?