Difference between revisions of "ShellExecute"

From HashVB
Jump to: navigation, search
m (Stopped it making the sample into a link)
(Earlsoft link)
Line 17: Line 17:
  
 
  ShellExecute 0, "print", App.Path & "\licence.rtf", "", "", 0
 
  ShellExecute 0, "print", App.Path & "\licence.rtf", "", "", 0
 +
 +
===See also===
 +
 +
* [http://www.earlsoft.co.uk/api/call.php?name=ShellExecute Earlsoft API page]
  
 
[[Category:API_Calls]]
 
[[Category:API_Calls]]

Revision as of 22:16, 21 July 2005

ShellExecute is normally used for opening/running "files".

The includes documents, audio files, pictures, URL links, etc...

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

The only parameter you really need to use is the lpFile parameter and maybe the lpOperation and the rest can be left at the default.
You can pass the path to the file or the URL you would like to open and what you want to do with it.

Sample usage

ShellExecute 0, "open", "http://www.earlsoft.co.uk/", "", "", 0
ShellExecute 0, "print", App.Path & "\licence.rtf", "", "", 0

See also