WndClass.hIcon = ghDefaultIcon;
WndClass.hIconSm = ghDefaultIconSm;
WndClass.hCursor = ghDefaultCursor;
- WndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); // The color of a terminal when it is switched off.
+ WndClass.hbrBackground = NULL;
WndClass.lpszMenuName = NULL;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = GWLP_CONWND_ALLOC;
PCONSRV_CONSOLE Console = GuiData->Console;
/* Do nothing if the window is hidden */
- if (!GuiData->IsWindowVisible) return;
+ if (!GuiData->IsWindowVisible || IsIconic(GuiData->hWindow)) return;
if (!ConDrvValidateConsoleUnsafe((PCONSOLE)Console, CONSOLE_RUNNING, TRUE)) return;
if ((windy % HeightUnit) >= (HeightUnit / 2)) ++chary;
/* Compensate for added scroll bars in window */
- if (charx < (DWORD)Buff->ScreenBufferSize.X) windy -= GetSystemMetrics(SM_CYHSCROLL); // Window will have a horizontal scroll bar
- if (chary < (DWORD)Buff->ScreenBufferSize.Y) windx -= GetSystemMetrics(SM_CXVSCROLL); // Window will have a vertical scroll bar
+ if (Buff->ViewSize.X < Buff->ScreenBufferSize.X) windy -= GetSystemMetrics(SM_CYHSCROLL); // Window will have a horizontal scroll bar
+ if (Buff->ViewSize.Y < Buff->ScreenBufferSize.Y) windx -= GetSystemMetrics(SM_CXVSCROLL); // Window will have a vertical scroll bar
charx = windx / (int)WidthUnit ;
chary = windy / (int)HeightUnit;
if (OnClose(GuiData)) goto Default;
break;
+ case WM_ERASEBKGND:
+ return TRUE;
+
case WM_PAINT:
OnPaint(GuiData);
break;