Code: Select all
// ...
#include <commctrl.h> // InitCommonControlsEx & ICC_ constants
#pragma comment(lib, "comctl32.lib") // link with comctl32.lib
typedef struct __tag_COMCTL_INIT {
__tag_COMCTL_INIT(DWORD dwICC = ICC_WIN95_CLASSES) {
#if (_WIN32_IE >= 0x0300)
INITCOMMONCONTROLSEX icc = {0};
icc.dwSize = sizeof(icc);
icc.dwICC = dwICC;
::InitCommonControlsEx(&icc);
#else // _WIN32_IE >= 0x0300
#pragma message("MSG: Compiling with _WIN32_IE < 0x0300: calling InitCommonControls instead of InitCommonControlsEx. ")
::InitCommonControls();
#endif // _WIN32_IE >= 0x0300
}
~__tag_COMCTL_INIT() {
}
} COMCTL_INIT;
static COMCTL_INIT __comctlinit(ICC_WIN95_CLASSES | ICC_LINK_CLASS);
Initializarea e cu titlu de exemplu, ICC_WIN95_CLASSES pentru controalele mai des folosite (listview, treeview, bars etc.) si ICC_LINK_CLASS pentru hyperlink control.
Vezi si
<< Back to Windows API Index