| View previous topic :: View next topic |
| Author |
Message |
Meeman Advanced Cheater
Reputation: 0
Joined: 15 Nov 2007 Posts: 54
|
Posted: Mon Dec 10, 2007 4:35 pm Post subject: making a program to run a game? |
|
|
hey,
heres the story. Theres a game on my computer. it doesnt need to be installed but just needs the exe to be double clicked to run the game. Unforunatly it takes up the whole screen. Is there anyway i can make a program that will window the game so it will be easier to run a trainer for it?
I used search but couldn't find what i was looking for.
_________________
I AM MEEMAN666!!!!!!!!!!
PPT277
programming languages i use: VB6, Delphi 7 , C# 2008, Python
You want to +Rep me!!!!!!! |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Dec 10, 2007 4:56 pm Post subject: |
|
|
DXWnd
or you could get 2 monitors
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Dec 10, 2007 5:18 pm Post subject: |
|
|
Hook the engine it is rendering with (OpenGL / DirectX) and force the game into a window. You may need to hook some other API as well such as CreatewindowExA/W and so on. I wrote a tutorial and an example for Need For Speed Most Wanted here:
Hooking DX9:
http://www.extalia.com/forums/viewtopic.php?f=45&t=2578
NFSMW Windower:
http://www.extalia.com/forums/viewtopic.php?f=45&t=2597
Or, as appal pointed out, you can use precreated programs which do the same thing. The only issue is, if the program has protection from being windowed or minimized, those programs will fail to help you and you will have to program your own in the long run.
Some API that is used to ensure the game has focus, isn't windowed or minimized, and is full screen would be:
SetForegroundWindow
GetForegroundWindow
SetFocus
GetFocus
ShowWindow
SetWindowPos
GetWindowRect
IsWindowVisible
DestroyWindow
GetWindowLongA
SetWindowsHookExA
IsIconic
There are others, but these ones are the ones I have found to be common in most games with given protection. That being said, you can hook all these API's and fake their returns when they are used with the games window.
For example, IsIconic checks if the window is minimized:
http://msdn2.microsoft.com/en-us/library/ms633527.aspx
With that the params are just the window handle, so you can redo the function like:
| Code: | BOOL Mine_IsIconic(HWND hWnd)
{
if( hWnd == GameHwnd ){
return FALSE;
}
return Orig_IsIconic(hWnd);
} |
_________________
- Retired. |
|
| Back to top |
|
 |
Meeman Advanced Cheater
Reputation: 0
Joined: 15 Nov 2007 Posts: 54
|
Posted: Mon Dec 10, 2007 5:33 pm Post subject: |
|
|
thanks guys. It works.
Thanks again
-MEEMAN666
_________________
I AM MEEMAN666!!!!!!!!!!
PPT277
programming languages i use: VB6, Delphi 7 , C# 2008, Python
You want to +Rep me!!!!!!! |
|
| Back to top |
|
 |
|