I create a tab control:
This code is called in a CreateTabControl function I created for this purpose. Then what I wanted it to do since my main window is being created with the WM_MAXIMIZE style (so the main window starts out smaller then what it becomes) is handle the WM_SIZE message in my main windows procedure in order to resize the tab control so it fills the entire client area of my main window:Code:// create the tab control GetClientRect(hwnd, &rect); hTC_Wnd = CreateWindowEx(0, WC_TABCONTROL, NULL, WS_VISIBLE | WS_TABSTOP | WS_BORDER | TCS_HOTTRACK, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, hwnd, NULL, g_hInst, NULL); if( hTC_Wnd == NULL ) return(2);
Now I have tried setting the (HMENU) for when I create the tab control to a valid value except that my program fails in creating the control if I actually try setting that parameter to any value. I'm not sure why this is, but I was forced to leave it as NULL. I did define IDC_TAB as 36000 and that was what I intended to use for this value by using (HMENU)IDC_TAB as that parameter except that it failed everytime whenever I tried to create the tab control.Code:case WM_SIZE: GetClientRect(hwnd, &rect); MoveWindow(hTC_Wnd, 0, 0, rect.right - rect.left, rect.bottom - rect.top, FALSE); break;
If you can assist, thanks.
Tyouk



LinkBack URL
About LinkBacks



