From 1083ceefdeeb798f9c1db8205af512a09716d480 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 23 Nov 2014 20:28:52 -0500 Subject: Added a "flag" (actually just specify at least one argument; doesn't matter what) to the Windows Table main() to specify using the lfMessageFont, for vertical centering testing purposes. --- wintable/main.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/wintable/main.c b/wintable/main.c index fb5682b..3f39b6b 100644 --- a/wintable/main.c +++ b/wintable/main.c @@ -1005,7 +1005,7 @@ void makeTableWindowClass(void) abort(); } -int main(void) +int main(int argc, char *argv[]) { HWND mainwin; MSG msg; @@ -1028,6 +1028,19 @@ int main(void) SendMessageW(mainwin, tableAddColumn, tableColumnText, (LPARAM) L"Column"); SendMessageW(mainwin, tableAddColumn, tableColumnImage, (LPARAM) L"Column 2"); SendMessageW(mainwin, tableAddColumn, tableColumnCheckbox, (LPARAM) L"Column 3"); + if (argc > 1) { + NONCLIENTMETRICSW ncm; + HFONT font; + + ZeroMemory(&ncm, sizeof (NONCLIENTMETRICSW)); + ncm.cbSize = sizeof (NONCLIENTMETRICSW); + if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof (NONCLIENTMETRICSW), &ncm, sizeof (NONCLIENTMETRICSW)) == 0) + abort(); + font = CreateFontIndirectW(&ncm.lfMessageFont); + if (font == NULL) + abort(); + SendMessageW(mainwin, WM_SETFONT, (WPARAM) font, TRUE); + } ShowWindow(mainwin, SW_SHOWDEFAULT); if (UpdateWindow(mainwin) == 0) abort(); -- cgit v1.2.3