summaryrefslogtreecommitdiff
path: root/wintable/main.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-11-23 20:28:52 -0500
committerPietro Gagliardi <[email protected]>2014-11-23 20:28:52 -0500
commit1083ceefdeeb798f9c1db8205af512a09716d480 (patch)
tree3cbb58e0ea8e00c64c2e71f48c791d55103eef60 /wintable/main.c
parent7b855d3abbd430964862e378dc0f445acf86f557 (diff)
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.
Diffstat (limited to 'wintable/main.c')
-rw-r--r--wintable/main.c15
1 files changed, 14 insertions, 1 deletions
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();