Launching Executables Via Max
BlitzMax Forums/BlitzMax Programming/Launching Executables Via Max
| ||
Is there a command for launching outside executables in Blitz Max similar to the ExecFile command in Blitz3D? I searched the excellent documentation for 10 minutes but was left wondering if there was a command for this or if I just couldn’t find it. |
| ||
Any of... OpenURL() CreateProcess() System_() |
| ||
Use 'execfile' as a search argument in the forum search function and you'll get lots of good information on the available alternatives plus how to use them |
| ||
Sorry to dig this up. But... OpenURL cannot take parameters, in other words, you can't do this: OpenURL("Notepad.exe myfile.txt") It will try to open a browser window because it converts the space to a %20. CreateProcess() can't leave an application running after you quit your BlitzMax program that called it. If you close your blitz program, the notepad window will also close. System_() makes the exe you called modal. Your calling Blitz program will not be able to do anything until the program you opened is closed. Is there another way? I need to call an exe with parameters and leave it running after my calling Blitz program is closed. Thanks for any help. |
| ||
If you don't need it to be multi-platform, you can use System_ to call cmd on Windows. Similar options are available on Linux (call bash?) and Mac I imagine. Edit: eg. System_("cmd /c start notepad.exe blah.txt") |
| ||
What I did was make a change to freeprocess.bmx. I added a Const LIVE. Then the Create function checks the flag and sets a variable 'bLive" to true. Then, when TerinateAll is called, I check bLive and if it is true, I do not terminate the process. Works like a charm. So, now when I call CreateProcess, if I set the flags parameter equal to LIVE (value of 2), the process will remain even after my calling app quits. One side effect is, if I were to manually call TemrinateAll, the process I started with LIVE won't die. I would need to kill it manually with a Terminate call to it specifically. |