aboutsummaryrefslogtreecommitdiff
path: root/c/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/main.c')
-rw-r--r--c/main.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/c/main.c b/c/main.c
index 4b3a91d..3f60407 100644
--- a/c/main.c
+++ b/c/main.c
@@ -11,6 +11,7 @@ HFONT HfBold;
HMENU HPopupMenu;
HWND HFocus;
HWND HWnd;
+int IDPI = -1;
static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
static INT_PTR CALLBACK AboutDlgProc(HWND, UINT, WPARAM, LPARAM);
static int Attach(void);
@@ -60,6 +61,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
tszErr = TEXT("Could not register window class.");
if (!RegisterClassEx(&wc)) goto f;
+
/* Create window. */
hWnd = CreateWindowEx(
@@ -67,11 +69,12 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
TEXT("Episode Browser"),
TEXT("Episode Browser"),
WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, CW_USEDEFAULT, 510, 400,
+ CW_USEDEFAULT, CW_USEDEFAULT, 0, 0,
NULL, NULL, hInstance, NULL
);
tszErr = TEXT("Could not create main window.");
if (!hWnd) goto f;
+ SetWindowPos(hWnd, NULL, -1, -1, Dpi(510), Dpi(400), SWP_NOMOVE);
SetupFonts();
ShowWindow(hWnd, nCmdShow);
@@ -121,6 +124,19 @@ WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_THEMECHANGED:
UpdateTheme();
break;
+ case 0x02E0: /* WM_DPICHANGED */
+ {
+ LPRECT lpr;
+ lpr = (LPRECT)lParam;
+ IDPI = HIWORD(wParam);
+ SetWindowPos(hWnd, NULL,
+ lpr->left, lpr->top,
+ lpr->right-lpr->left,
+ lpr->bottom-lpr->top,
+ SWP_NOZORDER | SWP_NOACTIVATE);
+ UpdateLayout();
+ break;
+ }
case WM_ACTIVATE:
switch (wParam) {
case WA_INACTIVE: