Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
BROWSER("C:\MYPATH\TheAppIWantToRun.EXE")
QUIT
** BROWSER IS THE ENCAPSULATION OF ShellExecute that I use
FUNCTION BROWSER
PARAMETER m.FILENAME,m.LINEPARAMS,m.TESTFILE
LOCAL LNRETVAL, LCOPERATION
PRIVATE m.FILENAME,m.LINEPARAMS,m.TESTFILE
LCOPERATION = "Open"
**
DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
INTEGER handle,;
STRING @sFile,;
STRING @lp,;
STRING @DIR,;
STRING @dir1,;
INTEGER ncmd
**
IF PCOUNT() < 3
m.TESTFILE = .T.
ENDIF
IF PCOUNT() < 2
m.LINEPARAMS = ""
ENDIF
IF m.TESTFILE
IF MYFILE(m.FILENAME)
LNRETVAL = SHELLEXECUTE(0, LCOPERATION, m.FILENAME, m.LINEPARAMS, "", 1)
ELSE
MESSAGEBOX("Unable to locate the File:"+m.FILENAME,48,"Problem")
ENDIF
ELSE
LNRETVAL = SHELLEXECUTE(0, LCOPERATION, m.FILENAME, m.LINEPARAMS, "", 1)
ENDIF
CLEAR DLLS SHELLEXECUTE
RETURN(.F.)
** BROWSER relies on MyFile
FUNCTION MYFILE
PARAMETER m.FILENAME,m.RETNAME,m.RETSIZE
PRIVATE m.FILENAME,m.RETNAME,m.RETVAL
IF PCOUNT() < 3
m.RETSIZE = .F.
ENDIF
IF PCOUNT() < 2
m.RETNAME = .F.
ENDIF
IF m.RETSIZE
m.RETVAL = 0
ELSE
IF m.RETNAME
m.RETVAL = ""
ELSE
m.RETVAL = .F.
ENDIF
ENDIF
IF !EMPTY(m.FILENAME)
IF ADIR(TMPDIRFILES,m.FILENAME) > 0
IF m.RETSIZE
m.RETVAL = TMPDIRFILES(1,2)
ELSE
IF m.RETNAME
m.RETVAL = TMPDIRFILES(1,1)
ELSE
m.RETVAL= .T.
ENDIF
ENDIF
ENDIF
RELEASE TMPDIRFILES
ENDIF
RETURN(m.RETVAL)
DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
lcFile = "MyExec.EXE" && put the name of your executable here
ShellExecute((0,cAction,lcFile,"","",1)
RUN /N My.exe.exe
QUIT
Again without typos:
cCmd = 'C:\Windows\Notepad.exe E:\Docs\MyFile.txt'
RUN /N &cCmd
Mandy said:it will open new application/program