2024-01-06 15:36:46 +00:00
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
extern CGame *pGame;
|
|
|
|
|
|
|
|
WNDPROC hOldProc;
|
|
|
|
LRESULT APIENTRY NewWndProc(HWND,UINT,WPARAM,LPARAM);
|
|
|
|
|
|
|
|
//----------------------------------------------------
|
|
|
|
|
2024-07-23 10:51:42 +00:00
|
|
|
void InstallWindowProcedure()
|
2024-01-06 15:36:46 +00:00
|
|
|
{
|
|
|
|
HWND hwndGameWnd = pGame->GetMainWindowHwnd();
|
|
|
|
|
|
|
|
if(hwndGameWnd) {
|
|
|
|
hOldProc = (WNDPROC)GetWindowLong(hwndGameWnd,GWL_WNDPROC);
|
|
|
|
if(hOldProc != NewWndProc) {
|
|
|
|
SetWindowLong(hwndGameWnd,GWL_WNDPROC,(LONG)NewWndProc);
|
|
|
|
}
|
|
|
|
}
|
2024-02-05 13:49:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------
|
|
|
|
|
|
|
|
BOOL SubclassGameWindow()
|
|
|
|
{
|
|
|
|
HWND hwndGameWnd = pGame->GetMainWindowHwnd();
|
|
|
|
|
2024-07-22 10:27:19 +00:00
|
|
|
if(hwndGameWnd) {
|
2024-02-05 13:49:33 +00:00
|
|
|
|
2024-07-22 10:27:19 +00:00
|
|
|
DWORD dwStyle = GetClassLong(hwndGameWnd,GCL_STYLE);
|
|
|
|
SetClassLong(hwndGameWnd,GCL_STYLE,dwStyle|CS_DBLCLKS);
|
2024-02-05 13:49:33 +00:00
|
|
|
|
2024-07-23 10:51:42 +00:00
|
|
|
InstallWindowProcedure();
|
2024-01-06 15:36:46 +00:00
|
|
|
|
2024-07-22 10:27:19 +00:00
|
|
|
SetWindowText(hwndGameWnd,"GTA:SA:MP");
|
2024-01-06 15:36:46 +00:00
|
|
|
|
2024-07-22 10:27:19 +00:00
|
|
|
if(IsWindowUnicode(hwndGameWnd)) {
|
|
|
|
OutputDebugString("GTA is unicode");
|
|
|
|
} else {
|
|
|
|
OutputDebugString("GTA is not unicode");
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2024-01-06 15:36:46 +00:00
|
|
|
}
|
2024-07-22 10:27:19 +00:00
|
|
|
return FALSE;
|
2024-01-06 15:36:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------
|
|
|
|
|
|
|
|
LRESULT APIENTRY NewWndProc( HWND hwnd,UINT uMsg,
|
|
|
|
WPARAM wParam,LPARAM lParam )
|
|
|
|
{
|
|
|
|
// TODO: NewWndProc
|
|
|
|
|
|
|
|
return CallWindowProc(hOldProc,hwnd,uMsg,wParam,lParam);
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------
|