%HI_ShellExecute function


Function
The function calls the function ShellExecuteEx Win32 API, which enables to open a file in a default viewer.
Declaration
%HI_ShellExecute(
   TEXT in sVerb,
   TEXT in sFile
 )
Parameters
sVerbRequired action.
sFileFilename.
Description
The action does not direct to the specific graphic object. Parameter sFile contains the file name over which the action is executed.

According to the value of sVerb the action is as follows:

""Executes default action (open).
"openas"Opens a dialog to select some program that will open the file.
"edit"Launches an editor and opens the document for editing. If sFile is not a document file, the function will fail.
"explore"Explores the folder specified by sFile.
"find"Initiates a search starting from the specified directory.
"open"Opens the file specified by the sFile parameter. The file can be executable, a document file, or a folder.
"print"Prints the document file specified by sFile. If sFile is not a document file, the function will fail.
"properties"Displays the file or folder's properties.

Other actions can be specified, however, they specifically depend on a file type.

The return value of the function matches the return value of the function Win32 API GetLastError. If successful, the return value is 0 (zero), otherwise, a numeric error code is returned.
Example
  ENTRY GO_OnClick
  INT _retCode
 ; Opens menu to select some browser of pdf documents

 _retCode := %HI_ShellExecute("openas", "d:\work\Hoard\asplos2000.pdf")
 ; Opens a default browser of pdf documents

 _retCode := %HI_ShellExecute("open", "d:\work\Hoard\asplos2000.pdf")
 END GO_OnClick 
Napíšte komentár