.NET Winform中,启用XP主题外观执行以下语句即可:
Application.EnableVisualStyles();

VC Win32项目,默认是不启用XP主题外观的,并不是每个人都喜欢简洁的Windows经典主题外观。
启用XP主题外观,需要用资源文件。有种更简单的方式:
头文件里加入以下语句:
#include <CommCtrl.h>
#pragma comment(lib, "ComCtl32.Lib")
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")

在main函数最前面调用InitCommonControls函数:
int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                    
int       nCmdShow)
{
    InitCommonControls();
    MessageBox(NULL, L
"Windows XP theme was enabled.", L"http://www.xianfen.net", 0 );
    
return 0;
}

运行程序已经启用了XP主题外观,如图:
VC++中启用XP主题外观

相关文章:

  • 2022-02-24
  • 2022-12-23
  • 2022-01-22
  • 2021-08-21
  • 2021-09-30
  • 2022-03-03
  • 2021-07-13
  • 2021-07-03
猜你喜欢
  • 2021-06-30
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2021-11-12
  • 2021-06-07
相关资源
相似解决方案