summaryrefslogtreecommitdiff
path: root/src/windows
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-05-15 18:41:45 +0200
committerAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-05-15 18:41:45 +0200
commit67eaee3cc90dbe413d5707b1e259c5036b47f55f (patch)
treeb04b3444bfc150596f2ba88357dc6e2ec232b7b8 /src/windows
parenta7f382b431e6eed3f180c71d4175970da096eab9 (diff)
work
Diffstat (limited to 'src/windows')
-rw-r--r--src/windows/platform.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/windows/platform.c b/src/windows/platform.c
index 375024a..0a1357b 100644
--- a/src/windows/platform.c
+++ b/src/windows/platform.c
@@ -4,6 +4,7 @@
* All rights reserved.
*/
+#include <tchar.h>
#include <locale.h>
#include <windows.h>
#include <GL/gl.h>
@@ -520,7 +521,14 @@ LRESULT CALLBACK main_window_callback(HWND window, UINT message, WPARAM wparam,
void platform_window_set_title(platform_window *window, char *name)
{
- SetWindowText(window->window_handle, name);
+ s32 len = strlen(name)+1;
+ wchar_t wc[len];
+ mbstowcs(wc, name, len);
+
+ LONG_PTR originalWndProc = GetWindowLongPtrW(window->window_handle, GWLP_WNDPROC);
+ SetWindowLongPtrW(window->window_handle, GWLP_WNDPROC, (LONG_PTR) DefWindowProcW);
+ SetWindowTextW(window->window_handle, wc);
+ SetWindowLongPtrW(window->window_handle, GWLP_WNDPROC, originalWndProc);
}
vec2 platform_get_window_size(platform_window *window)