Code:
case MCC_ADDTAB: {
if( ts->active >= 0 ) {
ShowWindow( ts->pages[ts->active], SW_HIDE );
}
ts->active++;
ts->nTabs++;
ts->ids = (int*)realloc( ts->ids, ts->nTabs*sizeof(int) );
ts->titles = (LPSTR*)realloc( ts->titles, ts->nTabs*sizeof(LPSTR) );
ts->pages = (HWND*)realloc( ts->pages, ts->nTabs*sizeof(HWND) );
ts->ids[ts->nTabs-1] = lParam;
ts->titles[ts->nTabs-1] = (LPSTR)wParam;
ts->pages[ts->nTabs-1] = CreatePage( hwnd, 1 );
ts->set = true;
SendMessage( GetParent( hwnd ), MCC_TABSEL, (WPARAM)ts->titles[ts->active],(LPARAM)ts->active );
InvalidateRect( hwnd, NULL, FALSE );
UpdateWindow( hwnd );
return 0;
}
In my WM_PAINT function depending on the value of ts->active it'll do something different. It works if I set it in other message cases but not this one for some weird reason.