diff --git a/source/terrax/mainWindow.cpp b/source/terrax/mainWindow.cpp index 4dc66368ec69ec709f44b0a0e04c6cb4565781da..2d97ff6f69c1184571749175656051e843ed4576 100644 --- a/source/terrax/mainWindow.cpp +++ b/source/terrax/mainWindow.cpp @@ -2182,6 +2182,10 @@ LRESULT CALLBACK RenderWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP DeleteObject(hcRotate); break; + case WM_SETTITLEASYNC: + SetWindowTextA(hWnd, (LPCSTR)lParam); + break; + default: return DefWindowProc(hWnd, message, wParam, lParam); } @@ -2276,7 +2280,7 @@ void XInitViewportLayout(X_VIEWPORT_LAYOUT layout) break; } - SendMessage(g_hWndMain, WM_COMMAND, MAKEWPARAM(ID_VIEW_AUTOSIZEVIEWS, 0), 0); + PostMessage(g_hWndMain, WM_COMMAND, MAKEWPARAM(ID_VIEW_AUTOSIZEVIEWS, 0), 0); g_xConfig.m_xViewportLayout = layout; SetMenuItemInfoA(g_hMenu, uMenuId, FALSE, &mii); diff --git a/source/terrax/terrax.cpp b/source/terrax/terrax.cpp index 8e7cd852bc99ff8e10879fabe3510159c5453a7d..0801048907c1191517123fffabb5a8a52b0a1989 100644 --- a/source/terrax/terrax.cpp +++ b/source/terrax/terrax.cpp @@ -1609,7 +1609,7 @@ bool XIsMouseInSelection(X_WINDOW_POS wnd) void XUpdateWindowTitle() { const char *szLevelName = g_sLevelName.c_str(); - char szCaption[256]; + static char szCaption[256]; bool isDirty = g_pUndoManager->isDirty(); if(szLevelName && szLevelName[0]) { @@ -1619,5 +1619,6 @@ void XUpdateWindowTitle() { sprintf(szCaption, "%s%s | %s", MAIN_WINDOW_TITLE, isDirty ? " - *" : "", SKYXENGINE_VERSION4EDITORS); } - SetWindowText(g_hWndMain, szCaption); + PostMessageA(g_hWndMain, WM_SETTITLEASYNC, 0, (LPARAM)szCaption); + // SetWindowText(g_hWndMain, szCaption); } diff --git a/source/terrax/terrax.h b/source/terrax/terrax.h index f334b9129a266c34266b1ac2e9c7f3835ccd06fa..7d9877817d1627f1ef3ebd2f76c88be708226547 100644 --- a/source/terrax/terrax.h +++ b/source/terrax/terrax.h @@ -26,6 +26,9 @@ #define AB_BUTTON_HEIGHT 40 #define OBJECT_TREE_HEIGHT 300 + +#define WM_SETTITLEASYNC (WM_USER + 1) + #include "Grid.h" enum X_VIEWPORT_LAYOUT