ShellExecute - Win32 API reference

From HashVB

Jump to: navigation, search

Opens or prints a specified file.

Declaration

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Parameters

hWnd
Window handle to a parent window. This window receives any message boxes that an application produces. For example, an application may report an error by producing a message box.
lpOperation
Address of a null-terminated string that specifies the operation to perform. The following operation strings are valid:

"open" The function opens the file specified by the lpFile parameter. The file can be an executable file or a document file. It can also be a folder.

"print" The function prints the file specified by lpFile. The file should be a document file.
If the file is an executable file, the function opens the file, as if "open" had been specified.

"explore" The function explores the folder specified by lpFile.

This parameter can be NULL. In that case, the function opens the file specified by lpFile.
lpFile
Address of a null-terminated string that specifies the file to open or print or the folder to open or explore. The function can open an executable file or a document file. The function can print a document file.
lpParameters
If the lpFile parameter specifies an executable file, lpParameters is an address to a null-terminated string that specifies the parameters to be passed to the application.
If lpFile specifies a document file, lpParameters should be NULL.
lpDirectory
Address of a null-terminated string that specifies the default directory.
nShowCmd
If lpFile specifies an executable file, nShowCmd specifies how the application is to be shown when it is opened.
Views
Personal tools