Page 1 of 1

launching and .exe from a ZGE .exe possible?

Posted: Sat Aug 25, 2012 1:53 pm
by jph_wacheski
When we built those arcade cabinet systems for the Hand Eye Society I made a little menu system, that just took the input from the controls, (gamepad) and launched the various games,. the program keep running in the back, and when the player quit one game, they could select another.

I built that in GameMaker as it was easy to do at the time. e.i.
execute_program(prog,arg,wait) Executes program prog with arguments arg. wait indicates whether to wait for finishing.
execute_shell(prog,arg) Executes the program (or file) in the shell.
Now however, I don't even have a copy of GM on this machine, and I am not sure it would run on win7 anyway (I never got a 8.1 upgrade). I was asked to build a little menu for a similar project, just wondering if there is a simple way to launch a program from ZGE? A ZGE menu would be much more interesting,. .

Posted: Sat Aug 25, 2012 2:11 pm
by Kjell
Hi jph,

Sure, see attached file for a simple example ( change the path to a executable that exists ). If you need any help making it work with relative paths instead of absolute, let me know.

K

Posted: Sat Aug 25, 2012 2:38 pm
by jph_wacheski
Excellent! Thanks so much, this will be great, I did not want to get into that old GM system again,. ZGE is way more fun.

I suspected it was possible though that external call interface,. just did not know the protocol. Thanks.

Posted: Sun Aug 26, 2012 11:19 pm
by Kjell
Erm,

Should have thought about this earlier .. because the WebOpen component basically calls ShellExecute when the InBrowser property is checked, you could simply use that as well :P

Code: Select all

ZZDC<?xml version="1.0" encoding="iso-8859-1" ?>
<WebOpen Url="C:\Program.exe" InBrowser="255"/>
K

Posted: Mon Aug 27, 2012 7:36 am
by VilleK
Kjell is always full of tricks ;). Either method will work well.