I want to know if this example is a good approach.
The Youtube solution seems to be a bit cumbersome. In particular, the code for the notify message could be solved with less effort.
Basically it should look like Richard McCutchan suggested.
BOOL OnNotify(HWND hwndTab, HWND* hwndDisplay, LPARAM lParam)
{
static int actualPage = 0;
switch (((LPNMHDR)lParam)->code)
{
case TCN_SELCHANGING:
{
return FALSE;
}
case TCN_SELCHANGE:
{
int iPage = TabCtrl_GetCurSel(hwndTab);
ShowWindow(hwndDisplay[actualPage], FALSE);
ShowWindow(hwndDisplay[iPage], TRUE);
actualPage = iPage;
break;
}
}
return TRUE;
}