From 217122a40e8a87b5c2d41422df48f66de2579f17 Mon Sep 17 00:00:00 2001 From: Samuel Yuan Date: Wed, 1 Apr 2015 11:14:46 -0400 Subject: [PATCH] Fixed UTF-8 encoding for window title --- Source/Project64/N64 System/Cheat Class.cpp | 3 +++ Source/Project64/N64 System/Rom Information Class.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Source/Project64/N64 System/Cheat Class.cpp b/Source/Project64/N64 System/Cheat Class.cpp index 76e166a56..8432f5573 100644 --- a/Source/Project64/N64 System/Cheat Class.cpp +++ b/Source/Project64/N64 System/Cheat Class.cpp @@ -1423,7 +1423,10 @@ int CALLBACK CCheats::ManageCheatsProc (HWND hDlg,DWORD uMsg,DWORD wParam, DWORD WndPlac.length = sizeof(WndPlac); GetWindowPlacement(hDlg, &WndPlac); + LONG_PTR originalWndProc = GetWindowLongPtrW(hDlg, GWLP_WNDPROC); + SetWindowLongPtrW(hDlg, GWLP_WNDPROC, (LONG_PTR) DefWindowProcW); SetWindowTextW(hDlg, GS(CHEAT_TITLE)); + SetWindowLongPtrW(hDlg, GWLP_WNDPROC, originalWndProc); _this->m_hSelectCheat = (HWND)CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Cheats_List),hDlg,(DLGPROC)CheatListProc,(LPARAM)_this); SetWindowPos((HWND)_this->m_hSelectCheat,HWND_TOP, 5, 8, 0, 0, SWP_NOSIZE); ShowWindow((HWND)_this->m_hSelectCheat,SW_SHOW); diff --git a/Source/Project64/N64 System/Rom Information Class.cpp b/Source/Project64/N64 System/Rom Information Class.cpp index 9bb96db11..974862969 100644 --- a/Source/Project64/N64 System/Rom Information Class.cpp +++ b/Source/Project64/N64 System/Rom Information Class.cpp @@ -53,7 +53,11 @@ DWORD CALLBACK RomInfoProc (HWND hDlg, DWORD uMsg, DWORD wParam, DWORD lParam) { SetProp(hDlg,"this",(RomInformation *)lParam); RomInformation * _this = (RomInformation *)lParam; + LONG_PTR originalWndProc = GetWindowLongPtrW(hDlg, GWLP_WNDPROC); + SetWindowLongPtrW(hDlg, GWLP_WNDPROC, (LONG_PTR) DefWindowProcW); SetWindowTextW(hDlg, GS(INFO_TITLE)); + SetWindowLongPtrW(hDlg, GWLP_WNDPROC, originalWndProc); + SetDlgItemTextW(hDlg, IDC_ROM_NAME, GS(INFO_ROM_NAME_TEXT)); SetDlgItemTextW(hDlg, IDC_FILE_NAME, GS(INFO_FILE_NAME_TEXT)); SetDlgItemTextW(hDlg, IDC_LOCATION, GS(INFO_LOCATION_TEXT));