First you will need to put this functions in you Src :
Soo, in you main thread, when the hooks are applied you do this :Code:long __stdcall MSetWindowLongA( HWND hWnd, int nIndex, DWORD dwNewLong ) { if( ( nIndex == GWL_STYLE ) ){ char szClassName[12]; GetClassNameA( hWnd, szClassName, 11 ); if( !strcmp( "RealSpace2", szClassName ) ){ dwNewLong = 2161049600; *(PBYTE)( (DWORD)( *(PDWORD)((DWORD)&dwNewLong + 4) ) + 8 ) = 0; } } return SetWindowLongA( hWnd, nIndex, (long)dwNewLong ); } void MIATHook( DWORD dwIATAddress, DWORD dwFunction ) { DWORD dwOld; VirtualProtect( (LPVOID)dwIATAddress, 4, PAGE_EXECUTE_READWRITE, &dwOld ); *(DWORD*)dwIATAddress = (DWORD)dwFunction; VirtualProtect( (LPVOID)dwIATAddress, 4, dwOld, &dwOld ); }
Compile and run, when you start the game will show a MsgBox asking if you want to start in windowed mode.Code:if( MessageBoxA( NULL, "Run in windowed mode ?", "You GunZ", MB_YESNO ) == IDYES ){ MIATHook( (DWORD)0x62245C, (DWORD)MSetWindowLongA ); }
Credits :
Me.



Reply With Quote


