i would like to add tabs to my tabcontrol.
..........................................................................
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Current code:
#include <windows.h>
#include <commctrl.h>
#define TAB_CONTROL 1
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow)
{
WNDCLASS wc{ 0 };
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hInstance = hInstance;
wc.lpszClassName = "window";
wc.lpfnWndProc = WndProc;
if (RegisterClass(&wc))
{
CreateWindow("window", "window", WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, 0, 0, 350, 350, 0, 0, 0, 0);
MSG Msg{ 0 };
while (GetMessage(&Msg, 0, 0, 0))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}
return 0;
}
LRESULT CALLBACK WndProc(HWND Hwnd, UINT Msg, WPARAM Wp, LPARAM Lp)
{
switch (Msg)
{
case WM_CREATE:
CreateWindow("SysTabControl32", 0, WS_CHILD | WS_VISIBLE, 0, 0, 350, 30, Hwnd, (HMENU)TAB_CONTROL, 0, 0);
/* what here to add tabs like ("tab1", "tab2", "tab3") and switch between them */
break;
case WM_COMMAND:
switch (Wp)
{}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(Hwnd, Msg, Wp, Lp);
}
}