DECLARE FUNCTION FindExecutable LIB "shell32.dll" ALIAS "FindExecutableA" (lpFile AS STRING,lpDirectory AS STRING, ByRef lpResult AS STRING) AS LONG
DECLARE FUNCTION ShellExecute LIB "shell32.dll" ALIAS "ShellExecuteA" (hwnd AS LONG,lpOperation AS STRING,lpFile AS STRING,lpParameters AS STRING,lpDirectory AS STRING,nShowCmd AS LONG) AS LONG
CONST SW_HIDE=0
CONST SW_SHOWNORMAL=1
CONST SW_NORMAL=1
CONST SW_SHOWMINIMIZED=2
CONST SW_SHOWMAXIMIZED=3
CONST SW_MAXIMIZE=3
CONST SW_SHOWNOACTIVATE=4
CONST SW_SHOW=5
CONST SW_MINIMIZE=6
CONST SW_SHOWMINNOACTIVE=7
CONST SW_SHOWNA=8
CONST SW_RESTORE=9
CONST SW_SHOWDEFAULT=10
CONST SW_MAX=10
TYPE QRun EXTENDS QOBJECT
FUNCTION FindApplication(FileName AS STRING) AS STRING
DIM ExeName AS STRING
DIM value AS LONG
ExeName=SPACE$(255)
value=FindExecutable(FileName,"",ExeName)
IF value>32 THEN
result=RTRIM$(ExeName)
ELSE
result=""
END IF
END FUNCTION
SUB FileRun(FileName AS STRING,cmdShow AS SHORT)
ShellExecute(0,"open",FileName,"","",cmdShow)
END SUB
SUB ExeRun(ExeName AS STRING,Param AS STRING,cmdShow AS SHORT)
ShellExecute(0,"open",ExeName,Param,"",cmdShow)
END SUB
END TYPE
|