diff --git a/src/os/gfx/win32/os_gfx_win32.c b/src/os/gfx/win32/os_gfx_win32.c index 4d7f72544..4db84f622 100644 --- a/src/os/gfx/win32/os_gfx_win32.c +++ b/src/os/gfx/win32/os_gfx_win32.c @@ -375,6 +375,7 @@ os_w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_CLOSE: { os_w32_push_event(OS_EventKind_WindowClose, window); + os_send_wakeup_event(); }break; case WM_LBUTTONUP: @@ -1489,7 +1490,7 @@ os_dpi_from_monitor(OS_Handle monitor) internal void os_send_wakeup_event(void) { - PostThreadMessageA(os_w32_gfx_state->gfx_thread_tid, 0x401, 0, 0); + PostThreadMessageW(os_w32_gfx_state->gfx_thread_tid, 0x401, 0, 0); } internal OS_EventList @@ -1498,13 +1499,13 @@ os_get_events(Arena *arena, B32 wait) os_w32_event_arena = arena; MemoryZeroStruct(&os_w32_event_list); MSG msg = {0}; - if(!wait || GetMessage(&msg, 0, 0, 0)) + if(!wait || GetMessageW(&msg, 0, 0, 0)) { B32 first_wait = wait; - for(;first_wait || PeekMessage(&msg, 0, 0, 0, PM_REMOVE); first_wait = 0) + for(;first_wait || PeekMessageW(&msg, 0, 0, 0, PM_REMOVE); first_wait = 0) { - DispatchMessage(&msg); TranslateMessage(&msg); + DispatchMessageW(&msg); if(msg.message == WM_QUIT) { os_w32_push_event(OS_EventKind_WindowClose, 0); @@ -1595,7 +1596,7 @@ hcursor = curs; }break; { if(hcursor != os_w32_gfx_state->hCursor) { - PostMessage(0, WM_SETCURSOR, 0, 0); + PostMessageW(0, WM_SETCURSOR, 0, 0); POINT p = {0}; GetCursorPos(&p); SetCursorPos(p.x, p.y);