Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


making a program to run a game?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Meeman
Advanced Cheater
Reputation: 0

Joined: 15 Nov 2007
Posts: 54

PostPosted: Mon Dec 10, 2007 4:35 pm    Post subject: making a program to run a game? Reply with quote

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
View user's profile Send private message AIM Address
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Dec 10, 2007 4:56 pm    Post subject: Reply with quote

DXWnd

or you could get 2 monitors

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Dec 10, 2007 5:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Meeman
Advanced Cheater
Reputation: 0

Joined: 15 Nov 2007
Posts: 54

PostPosted: Mon Dec 10, 2007 5:33 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites