diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-21 15:06:52 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-21 15:07:38 +0300 |
commit | d773b499e595a43b9b1ae449262dcf13cabf2d02 (patch) | |
tree | b1baeb12025a04f8316636b5d0ab18e30ceedb2c /src/win32.c |
Initial commit
Borrowing the app skeleton from Bitwise Harmony.
Diffstat (limited to 'src/win32.c')
-rw-r--r-- | src/win32.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/win32.c b/src/win32.c new file mode 100644 index 00000000..1cdcf34c --- /dev/null +++ b/src/win32.c | |||
@@ -0,0 +1,18 @@ | |||
1 | #include "win32.h" | ||
2 | #include <SDL_syswm.h> | ||
3 | |||
4 | #define WIN32_LEAN_AND_MEAN | ||
5 | #include <Windows.h> | ||
6 | |||
7 | void useExecutableIconResource_SDLWindow(SDL_Window *win) { | ||
8 | HINSTANCE handle = GetModuleHandle(NULL); | ||
9 | HICON icon = LoadIcon(handle, "IDI_ICON1"); | ||
10 | if (icon) { | ||
11 | SDL_SysWMinfo wmInfo; | ||
12 | SDL_VERSION(&wmInfo.version); | ||
13 | if (SDL_GetWindowWMInfo(win, &wmInfo)) { | ||
14 | HWND hwnd = wmInfo.info.win.window; | ||
15 | SetClassLongPtr(hwnd, -14 /*GCL_HICON*/, (LONG_PTR) icon); | ||
16 | } | ||
17 | } | ||
18 | } | ||