Post a message when the window title's text needs to change. This resolves #3282.

This commit is contained in:
The Dax committed 2013-09-14 12:49:50 -04:00
1 parent 670d0c35fe
commit 975b8cf7e7
3 files changed
+21 -24

No files matched your search

+13
View File
@@ -74,6 +74,7 @@
extern std::map<int, int> windowsTransTable;
BOOL g_bFullScreen = FALSE;
static RECT g_normalRC = {0};
static std::wstring windowTitle;
extern bool g_TakeScreenshot;
extern InputState input_state;
@@ -642,6 +643,14 @@ namespace MainWindow
g_Config.bEnableCheats = cheats;
}
void UpdateWindowTitle() {
DefWindowProcW(hwndMain, WM_SETTEXT, 0, (LPARAM)windowTitle.c_str());
}
void SetWindowTitle(const wchar_t *title) {
windowTitle = title;
}
BOOL Show(HINSTANCE hInstance, int nCmdShow) {
hInst = hInstance; // Store instance handle in our global variable.
@@ -1514,6 +1523,10 @@ namespace MainWindow
ResizeDisplay(true);
break;
case WM_USER_WINDOW_TITLE_CHANGED:
UpdateWindowTitle();
break;
case WM_MENUSELECT:
// Unfortunately, accelerate keys (hotkeys) shares the same enabled/disabled states
// with corresponding menu items.