GM: execute shell
From GMpedia.org Wiki
|
execute_shell | |
| Type: | function |
| Arguments: | 1: shell name 2: argument |
| Limitations: | none |
- The correct title of this article is execute_shell(). It appears incorrectly here because of technical restrictions.
The execute_shell function in Game Maker is used to execute a "shell". This can be a program, but can also be any type of file for which a file association has been set. The second argument can be any argument that needs to be passed.
A simple use of this function would be to print an image. To do this you do:
execute_shell("mspaint.exe","image.bmp /p")
This opens up the program Microsoft Paint, and then loads the image "image.bmp". The /p is the command that tells mspaint to print the image. Remember to leave a space between the file name and the /p, otherwise the /p will be taken as being part of the file name. It may be a better idea to use a Dll for printing, since then you could specify ceratin things, such as page size, borders, etc. Once the program msis open, you will have to close it again (however I can't remember the command for that).

