by Bird (7 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 21st June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Runs the Run file dialog API call.
API Declarations
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Function SHRunDialog Lib "shell32" Alias "#61" (ByVal hOwner As Long, ByVal Unknown1 As Long, ByVal Unknown2 As Long, ByVal szTitle As String, ByVal szPrompt As String, ByVal uFlags As Long) As Long
Dim sTitle As String, sPrompt As String
sTitle = "Run a program ..."
sPrompt = "Type the name of a program ..."
If IsWinNT Then
SHRunDialog Me.hWnd, 0, 0, StrConv(sTitle, vbUnicode), StrConv(sPrompt, vbUnicode), 0
Else
SHRunDialog Me.hWnd, 0, 0, sTitle, sPrompt, 0
End If
End Sub
Function IsWinNT() As Boolean
Dim OSInfo As OSVERSIONINFO
OSInfo.dwOSVersionInfoSize = Len(OSInfo)
Ret& = GetVersionEx(OSInfo)
IsWinNT = (OSInfo.dwPlatformId = 2)
End Function