RE:Abrir cualquier archivo desde clarion
Quiero cargar un archivo (bmp o mp3) como una aplicación predeterminada de quindows desde mi aplicación de windows?
RUN('comando de linea')
RUN Executes a command as if it were entered on the DOS command line.
command A string constant or variable containing the command to execute. This may include a full path and command line parameters.
waitflag An integer constant, variable, or EQUATE indicating whether RUN should launch the command and wait for its termination, or immediately return after launching. If omitted or zero (0), control immediately returns to the statement following the RUN. If one (1), control returns to the statement following the RUN only after the command has completed its execution.
The RUN statement executes a command to execute a DOS or Windows program. If the command parameter is a STRING variable, you must first use CLIP to remove trailing spaces (not necessary if the command is a CSTRING variable). Internally, RUN uses the winexec() Windows API call to execute the command.
When the command executes, the new program is loaded as the ontop and active program. Execution control in the launching program returns immediately to the statement following RUN and the launching program continues executing as a background application if the waitflag is set to zero (0). The user can return to the launching program by either terminating the launched program, or switching back to it through the Windows Task List. Execution control in the launching program returns to the statement following RUN only after the command has terminated its execution if the waitflag is set to one (1).
If the command does not contain a path to the program, the following search sequence is followed:
1. The DOS current directory
2. The Windows directory
3. The Windows system directory
4. Each directory in the DOS PATH
5. Each directory mapped in a network
The successful execution of the command may be verified with the RUNCODE procedure, which returns the DOS exit code of the command. If unsuccessful, RUN posts the error to the ERROR and ERRORCODE procedures.
Errors Posted: RUN may post any possible error
RUN('notepad.exe readme.txt') !Run Notepad, automatically loading readme.txt file
RUN(ProgNameC) !Run the command in the ProgNameC CSTRING variable
RUN(CLIP(ProgNameS)) !Run the command in the ProgNameS STRING variable
RUN('command.com /c MyBat.bat',1) !Run the command and wait for it to complete