Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than shell32, prefix the name with the module name and a period.
<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Function ShellExecuteEx(ByRef lpExecInfo As SHELLEXECUTEINFO) As Boolean
End Function
User-Defined Types:
VB.NET:
Public Structure SHELLEXECUTEINFO
Public cbSize As Integer
Public fMask As Integer
Public hwnd As IntPtr
<MarshalAs(UnmanagedType.LPTStr)> Public lpVerb As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpFile As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpParameters As String
<MarshalAs(UnmanagedType.LPTStr)> Public lpDirectory As String
Dim nShow As Integer
Dim hInstApp As IntPtr
Dim lpIDList As IntPtr
<MarshalAs(UnmanagedType.LPTStr)> Public lpClass As String
Public hkeyClass As IntPtr
Public dwHotKey As Integer
Public hIcon As IntPtr
Public hProcess As IntPtr
End Structure
Notes:
Check the SW constants at to see what value to pas in the nShow member. Typically you'll pass SW_SHOW.
Tips & Tricks:
Please add some!
Sample Code:
VB.NET
Dim info As SHELLEXECUTEINFO
info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info)
info.lpVerb = "open"
info.lpFile = System.IO.Path.Combine(Application.StartupPath, "readme.html")
info.nShow = SW_SHOW
If Not ShellExecuteEx(info) Then
Dim ex As New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error())
MessageBox.Show(ex.Message, "Error")
End If
Alternative Managed API:
Do you know one? Please contribute it!
The ShellExecuteEx API
8/15/2015 8:03:05 PM - Nige-81.171.173.35
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).