From fe0a24f38a3501906bd304b381e3510fce9b8891 Mon Sep 17 00:00:00 2001 From: Mark Reid Date: Tue, 6 Dec 2022 13:33:53 -0800 Subject: [PATCH] Examples: Win32: Fixed examples using RegisterClassW() since 1.89 to also call DefWindowProcW(). (#5725, #5961, #5975) Fixes the window title from being truncated on calls to Platform_SetWindowTitle. Stops the WM_SETTEXT message that happens when calling setWindowTextW from being interpreted as ascii. --- docs/CHANGELOG.txt | 3 +++ examples/example_win32_directx10/main.cpp | 2 +- examples/example_win32_directx11/main.cpp | 2 +- examples/example_win32_directx12/main.cpp | 2 +- examples/example_win32_directx9/main.cpp | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 36fcb3b1a..6c19b78a0 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -51,6 +51,9 @@ All changes: - PlotHistogram, PlotLines: Passing negative sizes honor alignment like other widgets. - ImDrawList: Added missing early-out in AddPolyline() and AddConvexPolyFilled() when color alpha is zero. +- Examples: Win32: Fixed examples using RegisterClassW() since 1.89 to also call + DefWindowProcW() instead of DefWindowProc() so that title text are correctly converted + when application is compiled without /DUNICODE. (#5725, #5961, #5975) [@markreidvfx] ----------------------------------------------------------------------- diff --git a/examples/example_win32_directx10/main.cpp b/examples/example_win32_directx10/main.cpp index 03af619ea..4fcc76cb0 100644 --- a/examples/example_win32_directx10/main.cpp +++ b/examples/example_win32_directx10/main.cpp @@ -243,5 +243,5 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ::PostQuitMessage(0); return 0; } - return ::DefWindowProc(hWnd, msg, wParam, lParam); + return ::DefWindowProcW(hWnd, msg, wParam, lParam); } diff --git a/examples/example_win32_directx11/main.cpp b/examples/example_win32_directx11/main.cpp index d7e5738df..f1a03354d 100644 --- a/examples/example_win32_directx11/main.cpp +++ b/examples/example_win32_directx11/main.cpp @@ -247,5 +247,5 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ::PostQuitMessage(0); return 0; } - return ::DefWindowProc(hWnd, msg, wParam, lParam); + return ::DefWindowProcW(hWnd, msg, wParam, lParam); } diff --git a/examples/example_win32_directx12/main.cpp b/examples/example_win32_directx12/main.cpp index 4de6246e3..961d34358 100644 --- a/examples/example_win32_directx12/main.cpp +++ b/examples/example_win32_directx12/main.cpp @@ -462,5 +462,5 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ::PostQuitMessage(0); return 0; } - return ::DefWindowProc(hWnd, msg, wParam, lParam); + return ::DefWindowProcW(hWnd, msg, wParam, lParam); } diff --git a/examples/example_win32_directx9/main.cpp b/examples/example_win32_directx9/main.cpp index 4c38768fb..494a94bd1 100644 --- a/examples/example_win32_directx9/main.cpp +++ b/examples/example_win32_directx9/main.cpp @@ -234,5 +234,5 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ::PostQuitMessage(0); return 0; } - return ::DefWindowProc(hWnd, msg, wParam, lParam); + return ::DefWindowProcW(hWnd, msg, wParam, lParam); }