From 279b0c7764c3e49db72606c25dd7151137d66b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 2 Apr 2022 23:57:16 +0200 Subject: Move initialization to WM_CREATE. WM_CREATE is sent as soon as the window is created. This means that it is not a good idea to set window-specific variables in the code following CreateWindow. Instead, they should be set in the window procedure's response to WM_CREATE. --- c/defs.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'c/defs.h') diff --git a/c/defs.h b/c/defs.h index 536a121..6982578 100644 --- a/c/defs.h +++ b/c/defs.h @@ -5,7 +5,6 @@ #include /* common.c */ -int Dpi(int); TCHAR *TszFromSz(const char *, int); /* main.c */ @@ -28,6 +27,13 @@ void ElvUpdateName(LPLVITEM); HWND DlvCreate(); void DlvShowEpisode(int); +inline int +Dpi(int i) +{ + extern int IDPI; + return MulDiv(i, IDPI, 96); +} + #define P(m,p,a,t) if (!PL_call_predicate(NULL, PL_Q_NORMAL, \ PL_predicate(p,a,m), t)) #define Q(m,p,a,t) PL_open_query(NULL, PL_Q_NORMAL, PL_predicate(p,a,m), t) -- cgit v1.2.3