RunProgram

Just starting out? Need help? Post your questions and find answers here.
jak64
Enthusiast
Enthusiast
Posts: 639
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

RunProgram

Post by jak64 »

Hello all,
I'm writing a program to be able to launch games by clicking on its name in a list.

To start the game, I use the following instruction:

Code: Select all

RunProgram("D:\MesJeux\(JEUX)\Mahjong\Aerial MahJong\Aerial MahJong.exe")
Of course the program path will be in a variable, this is just to test the RunProgram instruction

The game program launches but immediately closes!!!

Can you help me ?
AZJIO
Addict
Addict
Posts: 2225
Joined: Sun May 14, 2017 1:48 am

Re: RunProgram

Post by AZJIO »

Specify the working folder in the 3rd parameter or set it using SetCurrentDirectory()
https://www.purebasic.fr/english/viewto ... 00#p618900
jak64
Enthusiast
Enthusiast
Posts: 639
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: RunProgram

Post by jak64 »

Thank you AZJIO,

I wrote the instruction like below and it works.

Code: Select all

RunProgram("Aerial MahJong.exe","","D:\MesJeux\(JEUX)\Mahjong\Aerial MahJong\")
Also when I quit the game, my program (the one where there is the list of games) takes over.

This is so cool
AZJIO
Addict
Addict
Posts: 2225
Joined: Sun May 14, 2017 1:48 am

Re: RunProgram

Post by AZJIO »

You might be interested in the Launcher topic
jak64
Enthusiast
Enthusiast
Posts: 639
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: RunProgram

Post by jak64 »

Thank you AZJIO,
It's super beautiful but I have more than 300 games (these are games that are around twenty years old, BigbFish or Reflexive Arcade or others but that children really like.

I will therefore present the categories on the left (Match 3, Mahjong, Brick Breakers, Puzzles, Reflection, Reflexes, Bubble, etc...)
By clicking on a category, all the games in this category will be displayed in another area to the right of the categories.

By clicking on the name of a game, I will display screenshots of that game on the right side of the screen.

There will also be a button to put a game in another "My favorite games" area. I use a PanelGadget for this.

Of course, when a game is selected, there will be a button to launch it...

Here's my idea, I started coding and I like it the way I do it.
Post Reply