diff --git a/src/sys_win32.c b/src/sys_win32.c index 433778ba..badfad3e 100644 --- a/src/sys_win32.c +++ b/src/sys_win32.c @@ -12,6 +12,7 @@ #include "tls.h" #include "utf.h" +#define UNICODE #include #include #include @@ -930,8 +931,6 @@ INTERNAL LRESULT CALLBACK win32_window_proc(HWND hwnd, UINT msg, WPARAM wparam, struct utf16_decode_result decoded = utf16_decode((struct string16) { .len = ARRAY_COUNT(utf16_pair_bytes), .text = utf16_pair_bytes }); if (decoded.advance16 == 2 && decoded.codepoint < U32_MAX) { codepoint = decoded.codepoint; - } else { - codepoint = '?'; } } window->utf16_high_surrogate_last_input = 0; @@ -1923,9 +1922,9 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance, wc->hInstance = instance; /* Use first icon resource as window icon (same as explorer) */ - char path[MAX_PATH] = { 0 }; - GetModuleFileName(instance, path, MAX_PATH); - ExtractIconEx(path, 0, &wc->hIcon, &wc->hIconSm, 1); + wchar_t path[MAX_PATH] = { 0 }; + GetModuleFileNameW(instance, path, MAX_PATH); + ExtractIconExW(path, 0, &wc->hIcon, &wc->hIconSm, 1); if (!RegisterClassExW(wc)) { /* TODO: GetLastError */