Skip to content

Commit

Permalink
chore(lab-2): clear the code
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKonstantinSh committed Dec 24, 2020
1 parent a64c1cb commit c634569
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Lab_2/Lab_2/Lab_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit c634569

Please sign in to comment.