#include windows.h
#include commctrl.h
char className[]="TabControl";
LRESULT CALLBACK WindowProcedure(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpszArgument,int nFunsterStil){
MSG messages;
WNDCLASSEX wincl;
wincl.hInstance=hInstance;
wincl.lpszClassName=className;
wincl.lpfnWndProc=WindowProcedure;
wincl.style=0;
wincl.cbSize=sizeof(WNDCLASSEX);
wincl.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wincl.hIconSm=LoadIcon(NULL,IDI_APPLICATION);
wincl.hCursor=LoadCursor(NULL,IDC_ARROW);
wincl.lpszMenuName=NULL;
wincl.cbClsExtra=0;
wincl.cbWndExtra=0;
wincl.hbrBackground=HBRUSH(COLOR_3DFACE+1);
if(!RegisterClassEx(&wincl))return 0;
HWND windowHandle=CreateWindow(className,"TabControl",WS_OVERLAPPEDWINDOW,200,325,480,320,NULL,NULL,hInstance,NULL);
ShowWindow(windowHandle,SW_SHOW);
HWND tabHandle=CreateWindow(WC_TABCONTROL,"",WS_CHILD | WS_VISIBLE,6,0,474,320,windowHandle,NULL,hInstance,NULL);
TCITEM tab1Data;
tab1Data.mask=TCIF_TEXT;
tab1Data.pszText="Tab1";
TabCtrl_InsertItem(tabHandle,0,&tab1Data);
TCITEM tab2Data;
tab2Data.mask=TCIF_TEXT;
tab2Data.pszText="Tab2";
TabCtrl_InsertItem(tabHandle,0,&tab2Data);
ShowWindow(tabHandle,SW_SHOW);
while(GetMessage(&messages,NULL,0,0)){
TranslateMessage(&messages);
DispatchMessage(&messages);
};
return messages.wParam;
}
LRESULT CALLBACK WindowProcedure (HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
switch(message){
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,message,wParam,lParam);
};
return 0;
}