-2
我有一個基於MFC的應用程序,看起來太舊了,也許主題是Native windows。我知道在創建一個新的MFC應用程序時,可以選擇不同的視覺樣式。更改MFC應用程序的視覺樣式
我想現在選擇不同的視覺風格,也許是Windows 7.我該怎麼做?
編輯1:該應用程序是用Visual Studio 2005編寫的。因此,外觀和感覺太舊了。我已將其遷移到Visual Studio 2015,但外觀仍然相同。
我有一個基於MFC的應用程序,看起來太舊了,也許主題是Native windows。我知道在創建一個新的MFC應用程序時,可以選擇不同的視覺樣式。更改MFC應用程序的視覺樣式
我想現在選擇不同的視覺風格,也許是Windows 7.我該怎麼做?
編輯1:該應用程序是用Visual Studio 2005編寫的。因此,外觀和感覺太舊了。我已將其遷移到Visual Studio 2015,但外觀仍然相同。
Stdafx.h中有一些代碼:
#ifdef _UNICODE
#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
#endif
你確定是否正常工作?如果項目不是UNICODE,只需註釋#ifdef _UNICODE(和他的#endif對)以激活視覺樣式...
請參閱示例https://msdn.microsoft.com/en-us/ library/bb983962(v = vs.100).aspx – sergiol
如果您在Windows 7上運行,「本機」樣式與「Windows 7」樣式相同。這是什麼意思,該應用程序「看起來太舊」?這不是一回事。 MFC的內置主題很醜陋。無論如何,功能比形式更重要。 –
@CodyGray代碼是用VS 2005編寫的。我在VS 2015(Windows 7)上使用它。 – Shiv