I'm using Visual Studio 2005 (and win32 API in C++), and I have a window which was designed using the built-in dialog box editor.
At runtime, I want to be able to use CreateWindow()
to add new controls to it. This works, however the controls I create all look really ugly. For the purpose of concreteness, the control I'm adding is a TabControl, when I add it using the built-in dialog box editor, the text in the tab labels looks nice. When I create it at runtime with CreateWindow()
, the text is big and bold and looks out of place.
I found Using Windows XP Visual Styles on MSDN, which seems to describe stuff in the right area, but when I follow the instructions in there (embedding a manifest), the dynamically created control seems to be a newer style than the one used by the dialog box editor (the background of the tab control is a much lighter colour).
I also found the SetWindowTheme()
function. I'm not quite sure how to use this function... I was hoping that I could use GetWindowTheme()
on the window, and then pass the result of this into SetWindowTheme()
to make them look the same, however GetWindowTheme()
returns a HTHEME, and I have no idea what you can even do with these... you definitely can't pass them to SetWindowTheme()
though.