From c634569d9eefdbcfe13551c4f425224339deecf5 Mon Sep 17 00:00:00 2001 From: Shulga Konstantin Date: Thu, 24 Dec 2020 21:08:06 +0300 Subject: [PATCH] chore(lab-2): clear the code --- Lab_2/Lab_2/Lab_2.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lab_2/Lab_2/Lab_2.cpp b/Lab_2/Lab_2/Lab_2.cpp index 46c507d..347b204 100644 --- a/Lab_2/Lab_2/Lab_2.cpp +++ b/Lab_2/Lab_2/Lab_2.cpp @@ -53,7 +53,7 @@ void DrawTableWithText(HWND hWnd) int lengthOfDataItem = strlen(dataItem); SetRect(&rect, j * columnWidth + 1, tableHeight + 1, (j + 1) * columnWidth - 1, _userWindowHeight); - int strHeight = DrawTextA(hdc, dataItem, lengthOfDataItem, &rect, DT_WORDBREAK); + int strHeight = DrawText(hdc, dataItem, lengthOfDataItem, &rect, DT_WORDBREAK); if (strHeight > currentMaxColumnHeight) currentMaxColumnHeight = strHeight; @@ -72,6 +72,8 @@ void DrawTableWithText(HWND hWnd) MoveToEx(hdc, columnPosition, 0, NULL); LineTo(hdc, columnPosition, tableHeight); } + + EndPaint(hWnd, &paintStruct); } int APIENTRY WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR cmdLine, _In_ int cmdShowMode) @@ -146,6 +148,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_DESTROY: PostQuitMessage(0); return 0; + case WM_ERASEBKGND: + return 0; default: return DefWindowProc(hWnd, message, wParam, lParam); }