Enabling visual styles with C++ Win32 API?

use*_*668 5 c++ winapi visual-studio-2013

According to the MSDN article, visual styles are supposed to be applied to Win32 applications by default. However, the UI elements all appeared as Windows Classic until I inserted this into my header:

#pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
Run Code Online (Sandbox Code Playgroud)

Now, when I try to add a button using this call:

CreateWindow(L"button", L"Quit",
WS_VISIBLE | WS_CHILD,
120, 50, 80, 25,
hWnd, NULL, hInst, NULL);
Run Code Online (Sandbox Code Playgroud)

The result looks like this:

在此处输入图片说明

That looks like a Windows 8 button with Windows Classic font. Am I missing something to apply the full Windows 8 visual style?

Dav*_*nan 5

按钮是主题的,但您没有为按钮设置字体。因此,您的按钮具有默认字体。