Launching another application

BlitzMax Forums/BlitzMax Programming/Launching another application

ima747(Posted 2007) [#1]
Been searching around and can't seem to find what I'm looking for.

I need to launch an application from inside another, and quit the first app without closing the child. Preferably a cross platform solution.

Any thoughts? did I miss something in the code archives?


SebHoll(Posted 2007) [#2]
You can use OpenUrl() to open other programs/documents in their default application and, because it's a built-in BlitzMax command, it's cross-platform.

Example on Windows:
?Win32
'Let's open notepad
OpenURL(getenv_("windir")+"\Notepad.exe")
?
'Now let's terminate the current program and watch in awe as notepad stays open ;-)
End



ima747(Posted 2007) [#3]
Ah! I read that it didn't launch applications, but that was probably wrong/outdated/blitzplus. Thanks!


SebHoll(Posted 2007) [#4]
No probs!

Ah! I read that it didn't launch applications, but that was probably wrong/outdated/blitzplus. Thanks!

It's not blindingly obvious (the name or the docs don't help), but I remember asking BRL a year ago the exact same question that you did - they suggested using OpenUrl() and it worked (on all platforms too)! ;-)


ima747(Posted 2007) [#5]
Yea, it's exactly what I've done in other languages... just read the wrong thing and didn't try it myself... not a good day for my brain, but I'm making progress :0)

It doesn't accept augments though... dunno if I can work around that yet.


SebHoll(Posted 2007) [#6]
It doesn't accept augments though... dunno if I can work around that yet.

What do you mean by arguments - do you mean program switches?