Here's how I created the tabcontrol and the various associated tabs :
RECT client_rect;
GetClientRect(hwnd, &client_rect);
HWND tab_handle = CreateWindowEx(NULL, WC_TABCONTROL, NULL,
WS_CHILD | WS_VISIBLE,
10, 10, client_rect.right - client_rect.left - 20,
client_rect.bottom - client_rect.top - 20,
hwnd, NULL,
GetModuleHandle(NULL), NULL);
TCITEM tab_info;
memset(&tab_info, 0, sizeof(tab_info));
tab_info.mask = TCIF_TEXT;
tab_info.pszText = L"Tab #1";
tab_info.cchTextMax = 5;
SendMessage(tab_handle, TCM_INSERTITEM, 0, (LPARAM)&tab_info);
tab_info.pszText = L"Tab #2";
SendMessage(tab_handle, TCM_INSERTITEM, 1, (LPARAM)&tab_info);
tab_info.pszText = L"Tab #3";
SendMessage(tab_handle, TCM_INSERTITEM, 2, (LPARAM)&tab_info);
tab_info.pszText = L"Tab #4";
SendMessage(tab_handle, TCM_INSERTITEM, 2, (LPARAM)&tab_info);
tab_info.pszText = L"Tab #5";
SendMessage(tab_handle, TCM_INSERTITEM, 2, (LPARAM)&tab_info);
I'm using win7 controls (I read somewhere you really can't change it's text color property, is it true ?)
SubQuestion: why it works without having the need to call InitCommonControlsEx() ?