Jump to content
Sign in to follow this  
fireking300

Is it possible to Embedded a .exe such as a game?

Recommended Posts

fireking300

I want to Embed a game into my program its only a 1 part program that i have downloaded.

Share this post


Link to post
Share on other sites
NELyon

Run the EXE using Autoit, then use the SetParent DLLCall (_WinAPI_SetParent())

Share this post


Link to post
Share on other sites
fireking300

Im a little noobish at autoit a little so i need a little more explaination.

Share this post


Link to post
Share on other sites
NELyon

Untested:

#Include <WindowsConstants.au3>
#include <WinAPI.au3>
#Include <Constants.au3>
$hGUI = GUICreate("Test", 500, 500)
GUISetState()
Run("Path to game here.exe");Change the path to your EXE
Sleep(2000);Just to make sure the game is open
$hHandle = WinGetHandle("TItle of game window")
_WinAPI_SetWindowLong($hHandle, $GWL_STYLE, BitOr($WS_POPUP, $WS_VISIBLE))
_WinAPI_SetParent($hHandle, $hGUI)
Do
    Sleep(200)
Until GUIGetMsg() = -3

Share this post


Link to post
Share on other sites
fireking300

Ill test it.

Share this post


Link to post
Share on other sites
fireking300

It doesnt embed it but it runs it in the original window it runs it in.

Edited by fireking300

Share this post


Link to post
Share on other sites
NELyon

Did you change the title of the window in the WinGetHandle call?

Share this post


Link to post
Share on other sites
fireking300

No I didn't ill try that.

I changed the title. it didnt work

Edited by fireking300

Share this post


Link to post
Share on other sites
dworld

No I didn't ill try that.

I changed the title. it didnt work

kwarizmi posted here a nice embedding of a cmd.exe. Try it, maybe it'll help for you :)


dworldI'm new in autoit, but I like it. My mind is open to the new things.

Share this post


Link to post
Share on other sites
SadBunny

Don't you just mean, writing a script that INCLUDES the game executable?

Try looking up FileInstall() - it will put the installed file into your compiled script and unpack it to a location of your choice when you run the exe.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×