Use DefWindowProcW in win32 examples#5961
Conversation
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.
|
Hello, Thanks for the PR but this needs clarification. Please clarify how you are compiling the examples and what to do to repro said issue. (So i can confirm it locally). thanks! |
|
Oh, your right, now I see the |
|
I am still interested in this. |
|
In the docking branch, if your remove Add to this main loop ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::GetPlatformIO().Platform_SetWindowTitle(viewport, "Dynamic Title");You get the behavior I was getting. |
|
9 chances out of 10 the string was still getting converted to full unicode before passed to |
|
@nicolasnoble yes, without the complier defs, |
|
Yep, that's the wrong codepath :) We shouldn't call ASCII software will simply misbehave if passed a non-ASCII UTF-8 string, but there's little to do in this case... |
|
While #5975 is not as evident because it is a demo app, we should definitively make the multi-viewport backend behave with applications not compiled with
|
|
My apologies for misunderstanding this the first round. I have now merged your PR as fe0a24f |
…nt (should be no-op?). Amend 0a7054c (ocornut#5725, ocornut#1807, ocornut#471, ocornut#2815, ocornut#1060 + ocornut#9099, ocornut#3653, ocornut#5961)
…pport Unicode inputs on MBCS Windows. (ocornut#9099, ocornut#3653, ocornut#5961)
The current win32 examples will truncate the window title if you try to modify it with
Platform_SetWindowTitle.Before


After
It took me a while to figure out it was because the examples are using
DefWindowProcinsteadDefWindowProcW.The issue is
setWindowTextWsends aWM_SETTEXTmessage toWndProcand gets interpreted as ascii.Maybe this fix will help others from having to debug this issue when they are getting started using the examples :)