There are two things that are causing problems:
1. The handles need to be static or global
2. Notify needs to be more specific:
case WM_NOTIFY:
if(hTab == ((LPNMHDR)lParam)->hwndFrom &&
TCN_SELCHANGE == ((LPNMHDR)lParam)->code)
{
dwlResult = SendMessage(hTab, TCM_GETCURSEL, 0, 0);
switch (dwlResult) {
case 0:
hwndTabHandle = hDlgLog;
break;
case 1:
hwndTabHandle = hDlgInformation;
break;
case 2:
hwndTabHandle = hDlgProtection;
break;
case 3:
hwndTabHandle = hDlgAdvancedProtection;
break;
}
ShowWindow(PrevSelTab, SW_HIDE);
ShowWindow(hwndTabHandle, SW_SHOW);
PrevSelTab = hwndTabHandle;
return TRUE;
}