From d773b499e595a43b9b1ae449262dcf13cabf2d02 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 21 Jul 2020 15:06:52 +0300 Subject: Initial commit Borrowing the app skeleton from Bitwise Harmony. --- src/win32.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/win32.c (limited to 'src/win32.c') 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 @@ +#include "win32.h" +#include + +#define WIN32_LEAN_AND_MEAN +#include + +void useExecutableIconResource_SDLWindow(SDL_Window *win) { + HINSTANCE handle = GetModuleHandle(NULL); + HICON icon = LoadIcon(handle, "IDI_ICON1"); + if (icon) { + SDL_SysWMinfo wmInfo; + SDL_VERSION(&wmInfo.version); + if (SDL_GetWindowWMInfo(win, &wmInfo)) { + HWND hwnd = wmInfo.info.win.window; + SetClassLongPtr(hwnd, -14 /*GCL_HICON*/, (LONG_PTR) icon); + } + } +} -- cgit v1.2.3