[saco] Implement InstallNewWindowProcedure()

This commit is contained in:
RD42 2024-02-05 21:49:33 +08:00
parent 66ebd64042
commit 503cb19e4f

View File

@ -8,6 +8,20 @@ LRESULT APIENTRY NewWndProc(HWND,UINT,WPARAM,LPARAM);
//----------------------------------------------------
void InstallNewWindowProcedure()
{
HWND hwndGameWnd = pGame->GetMainWindowHwnd();
if(hwndGameWnd) {
hOldProc = (WNDPROC)GetWindowLong(hwndGameWnd,GWL_WNDPROC);
if(hOldProc != NewWndProc) {
SetWindowLong(hwndGameWnd,GWL_WNDPROC,(LONG)NewWndProc);
}
}
}
//----------------------------------------------------
BOOL SubclassGameWindow()
{
HWND hwndGameWnd = pGame->GetMainWindowHwnd();
@ -17,12 +31,7 @@ BOOL SubclassGameWindow()
DWORD dwStyle = GetClassLong(hwndGameWnd,GCL_STYLE);
SetClassLong(hwndGameWnd,GCL_STYLE,dwStyle|CS_DBLCLKS);
if(hwndGameWnd) {
hOldProc = (WNDPROC)GetWindowLong(hwndGameWnd,GWL_WNDPROC);
if(hOldProc != NewWndProc) {
SetWindowLong(hwndGameWnd,GWL_WNDPROC,(LONG)NewWndProc);
}
}
InstallNewWindowProcedure();
SetWindowText(hwndGameWnd,"GTA:SA:MP");