-
Notifications
You must be signed in to change notification settings - Fork 38
Gamedll integration winproc injector
hendrikp edited this page Oct 2, 2014
·
7 revisions
-
Inside the
CryGameSDK
project (Solution Explorer) open the following file:Startup Files / GameStartup.cpp
-
Replace the line (its important you don't add semicolons or braces)
LRESULT CALLBACK CGameStartup::WndProcHndl(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- with the following (ignore all intellisense warnings it fails for macros):
PLUGIN_SDK_WINPROC_INJECTOR(LRESULT CALLBACK CGameStartup::WndProcHndl(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam))
-
Inside the
CryGameSDK
project (Solution Explorer) open the following file:Startup Files / GameStartup.h
-
Find the declaration of the
WndProcHndl
method:
#ifdef WIN32
static LRESULT CALLBACK WndProcHndl(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
IBasicEventListener::EAction ProcessMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
#endif
- Make the declaration block
public
:
#ifdef WIN32
public: // <--
static LRESULT CALLBACK WndProcHndl(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
IBasicEventListener::EAction ProcessMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
private: // <--
#endif
- Please note that the WIN32 part is basically a check if were building on Windows not if were using 64bit. (64bit will work)
-
Inside the CryGame project (Solution Explorer) open the following file:
Startup Files / GameStartup.cpp
-
Replace the line (its important you don't add semicolons or braces)
LRESULT CALLBACK CGameStartup::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- with the following (ignore all intellisense warnings it fails for macros):
PLUGIN_SDK_WINPROC_INJECTOR(LRESULT CALLBACK CGameStartup::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam))
{
static int m_lastMoveX = 0;
static int m_lastMoveY = 0;
-
Inside the
CryGame
project (Solution Explorer) open the following file:Startup Files / GameStartup.cpp
-
Replace the line (its important you don't add semicolons or braces)
LRESULT CALLBACK CGameStartup::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- with the following (ignore all intellisense warnings it fails for macros):
PLUGIN_SDK_WINPROC_INJECTOR(LRESULT CALLBACK CGameStartup::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam))