|
Previous Top Next |
Prototype: | (String pCommandLine, Long pWait=0, <String pParameters>,<String pStartupFolder>,Byte pElevate=0, Byte pShowWaitWindow=1),IT_HANDLE,PROC |
pCommandline | Path and name of program or file to execute. If the path is a long path (i.e. including spaces and long filename) we advise that you use double quotes around the command line. Note that this should not contain any parameters strings, use the pParameters parameter for that. |
pWait | True or false to indicate if the method should wait for the program to finish. If this parameter is false the method returns a handle to the started process. If this parameter is false, the pShowWaitWindow parameter is ignored and the wait window is not shown. Default value is false (0) |
pParameters | Optional parameters to pass to the executed program. If a parameter contains a long filename or path we advise that you use double quotes around that parameter value. |
pStartupFolder | Optional startup folder. If this parameter is supplied it must point to a valid folder and the program will then behave as it if was run in the Startup Folder. |
pElevate | Optional parameter that is only valid under Vista, Windows Server 2008, Windows 7 or later operating systems where User Account Control is active. If set to True it will force the called program to run elevated. |
pShowWaitWindow | Optional parameter to indicate if the Wait window should be shown or not: |
This parameter defaults to True - i.e. to show the window.
Returns | Returns the handle to the process if pWait is false. If pWait is true it returns the exit code from the called process or if no exit code was received it returns the return value from WaitForSingleObject API. |
The ITRunWait method is a replacement for the RUN statement in the Clarion runtime library. The advantages of using ITRun is that it will automatically elevate a program if it needs to where as RUN() cannot do that. You can also set the startup folder which you cannot do with RUN and you can also force elevation under Vista and newer operating systems where User Account Control (UAC) is active.
Example:
ITS ITShellClass
Loc:ProgramToRun CString(2049)
Loc:WaitForProgram Byte
Code
Loc:WaitForProgram = True
Loc:ProgramToRun = '"C:\program files\Icetips Alta LLC\My program.exe"'
If Loc:ProgramToRun
ITS.ITRun(Loc:ProgramToRun,Loc:WaitForProgram)
End
See also: