From 4ec130efd5131f7cf2c48a1625291efdd522e048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 31 Mar 2022 00:24:52 +0200 Subject: Set minimum window height. --- c/main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'c/main.c') diff --git a/c/main.c b/c/main.c index 1e79634..09227b9 100644 --- a/c/main.c +++ b/c/main.c @@ -99,6 +99,13 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SIZE: UpdateLayout(); break; + case WM_GETMINMAXINFO: + { + LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam; + extern HWND HDlv; + lpMMI->ptMinTrackSize.y = LvHeight(HDlv)+80; + break; + } case WM_CREATE: { HWnd = hWnd; @@ -250,7 +257,7 @@ void UpdateLayout() { HWND hElv, hDlv; - int cxColumn, cyDlv, iCount; + int cxColumn, cyDlv; RECT rc; static int cxVScroll = 0; @@ -261,8 +268,7 @@ UpdateLayout() /* Resize data list view. */ hDlv = GetDlgItem(HWnd, IDC_DATALISTVIEW); - iCount = ListView_GetItemCount(hDlv); - cyDlv = rc.bottom - (iCount ? 27+iCount*19 : 0); + cyDlv = rc.bottom - LvHeight(hDlv); MoveWindow(hDlv, 0, cyDlv, rc.right, rc.bottom, TRUE); cxColumn = ListView_GetColumnWidth(hDlv, 0); @@ -277,6 +283,7 @@ UpdateLayout() ListView_SetColumnWidth(hElv, 1, rc.right-cxColumn-cxVScroll-4); } +/* Try to style application according to current Windows theme. */ void UpdateTheme() { -- cgit v1.2.3