mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[saco] Implement SubclassGameWindow
- Adds NewWndProc stub
This commit is contained in:
parent
83688aa2ff
commit
94a25da90d
@ -344,6 +344,9 @@
|
||||
<File
|
||||
RelativePath=".\sha1.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\subclass.cpp">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
48
saco/subclass.cpp
Normal file
48
saco/subclass.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
extern CGame *pGame;
|
||||
|
||||
WNDPROC hOldProc;
|
||||
LRESULT APIENTRY NewWndProc(HWND,UINT,WPARAM,LPARAM);
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
BOOL SubclassGameWindow()
|
||||
{
|
||||
HWND hwndGameWnd = pGame->GetMainWindowHwnd();
|
||||
|
||||
if(!hwndGameWnd) return FALSE;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
SetWindowText(hwndGameWnd,"GTA:SA:MP");
|
||||
|
||||
if(IsWindowUnicode(hwndGameWnd)) {
|
||||
OutputDebugString("GTA is unicode");
|
||||
} else {
|
||||
OutputDebugString("GTA is not unicode");
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
LRESULT APIENTRY NewWndProc( HWND hwnd,UINT uMsg,
|
||||
WPARAM wParam,LPARAM lParam )
|
||||
{
|
||||
// TODO: NewWndProc
|
||||
|
||||
return CallWindowProc(hOldProc,hwnd,uMsg,wParam,lParam);
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
Loading…
x
Reference in New Issue
Block a user