diff options
author | John Ankarström <john@ankarstrom.se> | 2022-04-02 23:57:16 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-04-02 23:57:16 +0200 |
commit | 279b0c7764c3e49db72606c25dd7151137d66b70 (patch) | |
tree | 9b79c76f2aaa156de7f03aa52635f123ac0ad305 /c/common.c | |
parent | 7e52a92bac667723885f689a1310d93144bd6a11 (diff) | |
download | EpisodeBrowser-279b0c7764c3e49db72606c25dd7151137d66b70.tar.gz |
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.
Diffstat (limited to 'c/common.c')
-rw-r--r-- | c/common.c | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -4,26 +4,6 @@ #include "resource.h" #include "defs.h" -/* Scale integer according to DPI. */ -int Dpi(int i) -{ - extern int IDPI; - - if (IDPI == -1) { - HMODULE hModule; - FARPROC GetDpiForWindow; - extern HWND HWnd; - IDPI = 96; - hModule = LoadLibrary(TEXT("User32.dll")); - if (hModule && (GetDpiForWindow = GetProcAddress(hModule, "GetDpiForWindow"))) { - IDPI = GetDpiForWindow(HWnd); - FreeLibrary(hModule); - } - } - - return MulDiv(i, IDPI, 96); -} - /* Convert normal string to TSTR using given codepage. */ TCHAR * TszFromSz(const char *sz, int iCp) |