win32/C dialog box: "modern" look / style for a combo box
I want my dialog box (resource) in a Win32/C app to have a "modern" look/style, particularly its combo boxes. By "modern", I mean that a "drop list"-type combo box looks like a solid button, with just a small "arrow" icon on the side, as opposed to the "old" look: flat edit box with a separate arrow button. In the VS dialog editor, the combo boxes look "modern". When I run the app, they look "old". How do I force the "modern" style on the dialog? This is what I tried, in vain:
#include "commctrl.h"
#include "Uxtheme.h"
setDia = CreateDialog(NULL, MAKEINTRESOURCE(IDD_DIA_SET), win, DialogProc);
SetWindowTheme(setDia, L"Explorer", NULL);
I wrote a few Win32/C++ apps and their dialog boxes (also resources) get the "modern" look out of the box, without my doing anything. Is it C vs. C++ 开发者_Go百科that makes a difference?
You most likely have to specify the correct version of comctl32.dll via a manifest, especially selecting v. 6 (e.g., 6.0.2900.5512). See the following MSDN article for more info: Enabling Visual Styles
精彩评论