| Home | All functions | Categories |
vuRunExDelay(*CSTRING pFile, *CSTRING pParams, *CSTRING pWork, LONG ShowCmd, LONG DelayMS), LONG
Runs an external program with optional parameters and working directory after a specified delay.
| Function | Separate File/Params | Working Folder | Delay | Wait | Notes |
|---|---|---|---|---|---|
| vuRun | No | No | No | Yes | Single command-line string. Good for simple or legacy launches. |
| vuRunDelay | No | No | Yes | No | Single command-line string with a startup delay. |
| vuRunEx | Yes | Yes | No | No | Preferred modern launch when you want file and parameters passed separately. |
| vuRunExWait | Yes | Yes | No | Yes | Preferred modern launch with separate parameters and optional wait. |
| vuRunExDelay | Yes | Yes | Yes | No | Modern launch with separate parameters plus startup delay. |
| vuRunExDelayWait | Yes | Yes | Yes | Yes | Modern launch with separate parameters, startup delay, and optional wait. |
| vuRunExists | No | No | No | No | Runs only if the target file already exists. |
| vuRunExistsEx | No | No | Polls for file | No | Waits for a file to appear, then runs it. |
| Parameter | Data Type | Description |
|---|---|---|
| pFile | *CSTRING |
Path to the executable file to run. |
| pParams | *CSTRING |
Optional command-line parameters to pass to the executable. |
| pWork | *CSTRING |
Optional working directory for the process. |
| ShowCmd | LONG | Window show mode (see Windows SW_* constants). |
| DelayMS | LONG | Delay in milliseconds before the program is launched. |
Build 210 window-style correction: ShowCmd = 0 now means SW_HIDE (hidden), as documented by Windows. Previous builds incorrectly converted zero to a normal visible window. Use ShowCmd = 1 for normal display. This changes the previous behavior for callers that passed zero expecting a visible window. For console tests, pass ShowCmd = 0 explicitly; 1 requests a visible window. Windows treats ShellExecuteEx display styles as requests, so an application may still control its own display.
CSTRING size note: CSTRING(1024) in this example is a caller-side declaration, not an unlimited-length guarantee. This function copies the relevant path, parameter, or working-folder text into internal 1,024-byte null-terminated buffer(s), so each copied value must fit (up to 1,023 characters plus its null byte). Longer input may be truncated; Windows can impose additional restrictions. See CSTRING Sizes and Buffer Capacity.
A LONG value indicating the result:
FilePath CSTRING(1024)
Params CSTRING(1024)
WorkFolder CSTRING(1024)
ShowCmd LONG
DelayMS LONG
Ret LONG
FilePath = 'C:\Windows\Notepad.exe'
Params = 'MyDoc.txt'
WorkFolder = ''
ShowCmd = 1
DelayMS = 2000
Ret = vuRunExDelay(FilePath, Params, WorkFolder, ShowCmd, DelayMS)
MESSAGE('vuRunExDelay returned: ' & FORMAT(Ret), 'vuRunExDelay')
| Home | All functions | Categories |