|
Option Explicit
Private Declare Function SHRunDialog Lib "shell32" Alias _
"#61" (ByVal hWnd As Long, ByVal hIcon As Long, _
ByVal sPath As String, ByVal sTitle As String, _
ByVal sPrompt As String, ByVal uFlags As Long) As Long
Private Declare Function ExtractIcon Lib "shell32.dll" Alias _
"ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName _
As String, ByVal nIconIndex As Long) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" _
Alias "GetSystemDirectoryA" (ByVal lpBuffer As _
String, ByVal nSize As Long) As Long
Dim RetVal As Long
Dim SysDir As String
Dim hIcon As Long
Private Sub Form_Load()
g_fIsWinNT = IsWinNT
End Sub
Private Sub Command1_Click()
Dim uFlag As Long
Dim sTitle As String, sPrompt As String, sLw As String
If Option1(0).Value = True Then
SHRunDialog hWnd, 0, 0, vbNullString, vbNullString, 0
Else
If Check1(0).Value = 1 Then uFlag = &H3 Else uFlag = &H2
If Check1(1).Value = 1 Then
SysDir = Space$(256)
RetVal = GetSystemDirectory(SysDir, Len(SysDir))
If RetVal <> 0 Then
SysDir = Left$(SysDir, Len(Trim$(SysDir)) - 1) & _
"\Shell32.dll"
hIcon = ExtractIcon(App.hInstance, SysDir, 11)
End If
Else
hIcon = 0
End If
sTitle = Text1.Text
sPrompt = Text2.Text
sLw = Text3.Text
If g_fIsWinNT Then
sTitle = StrConv(sTitle, vbUnicode)
sPrompt = StrConv(sPrompt, vbUnicode)
sLw = StrConv(sLw, vbUnicode)
End If
SHRunDialog hWnd, hIcon, sLw, sTitle, sPrompt, uFlag
End If
End Sub
|
|