|
Previous Top Next |
Prototype: | (String pCommandLine, Long pWait=0, <String pParameters>,<String pStartupFolder>,Byte pElevate=0),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. 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. For other operating systems or if UAC is turned off, this parameter is ignored. If set to True it will force the called program to run elevated. |
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. Note: November 12, 2011: This has changed slightly, so that if the called process returns no exit code, the method returns 0 instead of the return value from WaitForSingleObject. The reason for this change is that it is possible that if the called process returns nothing and WaitForSingleObject returns a value that the calling code is expecting, the results are wrong. |
The ITRun 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: