From ed1646d102779c76e8f0955554d39c154b5a378e Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:27:19 +0800 Subject: [PATCH] [saco] Match `SubclassGameWindow()` --- saco/subclass.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/saco/subclass.cpp b/saco/subclass.cpp index f02192d..3b053fb 100644 --- a/saco/subclass.cpp +++ b/saco/subclass.cpp @@ -26,22 +26,24 @@ BOOL SubclassGameWindow() { HWND hwndGameWnd = pGame->GetMainWindowHwnd(); - if(!hwndGameWnd) return FALSE; + if(hwndGameWnd) { - DWORD dwStyle = GetClassLong(hwndGameWnd,GCL_STYLE); - SetClassLong(hwndGameWnd,GCL_STYLE,dwStyle|CS_DBLCLKS); + DWORD dwStyle = GetClassLong(hwndGameWnd,GCL_STYLE); + SetClassLong(hwndGameWnd,GCL_STYLE,dwStyle|CS_DBLCLKS); - InstallNewWindowProcedure(); + InstallNewWindowProcedure(); - SetWindowText(hwndGameWnd,"GTA:SA:MP"); + SetWindowText(hwndGameWnd,"GTA:SA:MP"); - if(IsWindowUnicode(hwndGameWnd)) { - OutputDebugString("GTA is unicode"); - } else { - OutputDebugString("GTA is not unicode"); + if(IsWindowUnicode(hwndGameWnd)) { + OutputDebugString("GTA is unicode"); + } else { + OutputDebugString("GTA is not unicode"); + } + + return TRUE; } - - return TRUE; + return FALSE; } //----------------------------------------------------