Shell, process management, OS specific functionality.
◆ PROCESS
◆ EShellExecuteWindowState
Determines the initial window state when using shell_execute to execute a process.
| Enumerator |
|---|
| FOREGROUND | The process window is opened in the foreground and activated.
|
| BACKGROUND | The process window is opened in the background without focus.
|
◆ cmdline_fix()
Fixes the command line arguments to be encoded in UTF-8 on all systems.
- Parameters
-
| argc | A pointer to the argc parameter that was passed to the main function. |
| argv | A pointer to the argv parameter that was passed to the main function. |
◆ cmdline_free()
Frees memory that was allocated by cmdline_fix.
- Parameters
-
| argc | The argc obtained from cmdline_fix. |
| argv | The argv obtained from cmdline_fix. |
◆ is_process_alive()
Checks if a process is alive.
- Parameters
-
| process | Handle/PID of the process. |
- Returns
true if the process is currently running,
-
false if the process is not running (dead).
◆ kill_process()
Sends kill signal to a process.
- Parameters
-
| process | Handle of the process to kill. |
- Returns
1 on success, 0 on error.
◆ open_file()
Opens a file or directory with the default program.
- Parameters
-
| path | The file or folder to open with the default program. |
- Returns
1 on success, 0 on failure.
◆ open_link()
Opens a link in the browser.
- Parameters
-
| link | The link to open in a browser. |
- Returns
1 on success, 0 on failure.
◆ os_locale_str()
Returns a string of the preferred locale of the user / operating system. The string conforms to RFC 3066 and only contains the characters a-z, A-Z, 0-9 and -. If the preferred locale could not be determined this function falls back to the locale "en-US".
- Parameters
-
| locale | Buffer to use for the output. |
| length | Length of the output buffer. |
◆ os_version_str()
Returns a human-readable version string of the operating system.
- Parameters
-
| version | Buffer to use for the output. |
| length | Length of the output buffer. |
- Returns
true on success, false on failure.
◆ pid()
Returns the ID of the current process.
- Returns
- PID of the current process.
◆ shell_execute()
Executes a given file.
- Parameters
-
| file | The file to execute. |
| window_state | The window state how the process window should be shown. |
| arguments | Optional array of arguments to pass to the process. |
| num_arguments | The number of arguments. |
- Returns
- Handle of the new process, or INVALID_PROCESS on error.
◆ INVALID_PROCESS
A handle that denotes an invalid process.