Abs62 Ура, вроде сделал:
Код: //---------------------------------------------------------------------------------------------------------------------------
LONG WINAPI MainWindowProcedure (
HWND Window,
UINT Message,
WPARAM wParam,
LPARAM lParam
)
{
RECT RC1;
PAINTSTRUCT ps;
HDC hdc;
switch (Message)
{
case WM_CREATE:
{
//-----------------------------------
t1 = GetSystemMetrics(SM_CYCAPTION);
t2 = GetSystemMetrics(SM_CXSIZEFRAME);
t3 = GetSystemMetrics(SM_CYSIZEFRAME);
//-----------------------------------
self_TabSheet = CreateWindow (
"SysTabControl32",
"",
WS_CHILD|WS_VISIBLE,
0, 0, 0, 0,
Window,
(HMENU)0,
m_hInstance,
NULL
);
SendMessage(self_TabSheet, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(true, 0));
TabItem.mask = TCIF_TEXT|TCIF_PARAM;
TabItem.dwState = 0;
TabItem.dwStateMask = 0;
TabItem.pszText = "Система";
TabItem.cchTextMax = 10;
TabItem.iImage = 0;
TabItem.lParam = (LPARAM)0;
SendMessage(self_TabSheet, TCM_INSERTITEM, 1, (LPARAM)&TabItem);
TabItem.mask = TCIF_TEXT|TCIF_PARAM;
TabItem.dwState = 0;
TabItem.dwStateMask = 0;
TabItem.pszText = "Система";
TabItem.cchTextMax = 10;
TabItem.iImage = 0;
TabItem.lParam = (LPARAM)0;
SendMessage(self_TabSheet, TCM_INSERTITEM, 2, (LPARAM)&TabItem);
SetWindowLong(self_TabSheet, GWL_WNDPROC, (long)&SubTabControlProc);
return 0;
}
case WM_PAINT:
{
GetClientRect(Window, &RC1);
hdc = BeginPaint (Window, &ps);
PatBlt(memDC,t2,t1+t2,RC1.right-RC1.left, RC1.bottom-RC1.top, PATCOPY);
//-----------
SendMessage(Window, WM_PRINT, (WPARAM)memDC, (LPARAM)(PRF_CLIENT|PRF_CHILDREN|PRF_CHECKVISIBLE|PRF_ERASEBKGND|PRF_OWNED));
//-----
BitBlt(hdc, 0, 0, RC1.right-RC1.left, RC1.bottom-RC1.top, memDC, t2, t1+t2, SRCCOPY);
EndPaint (Window, &ps);
return 0;
}
case WM_ERASEBKGND:
{
return 1;
}
case WM_SIZE:
{
GetClientRect(Window, &RC1);
MoveWindow(self_TabSheet, RC1.left+10, RC1.top+10, RC1.right-20, RC1.bottom-20, true);
return 0;
}
case WM_DESTROY:
{
PostQuitMessage(0);
return 0;
}
}
return DefWindowProc (
Window,
Message,
wParam,
lParam
);
}
//---------------------------------------------------------------------------------------------------
LONG WINAPI SubTabControlProc (
HWND Window,
UINT Message,
WPARAM wParam,
LPARAM lParam
)
{
HDC hdc;
PAINTSTRUCT ps;
HWND pWnd = GetParent(Window);
switch (Message)
{
case WM_PAINT://Выключаем перерисовку без двойной буферизации
{
InvalidateRect(pWnd, NULL, true);
hdc = BeginPaint (Window, &ps);
EndPaint (Window, &ps);
return 0;
}
}
return CallWindowProc (
oldTabControlProc,
Window,
Message,
wParam,
lParam
);
}
//---------------------------------------------------------------------------------