I'm trying to learn how to use this API function.
The code I have is:
'In Module:
Declare Function Shellexecute% Lib "shell.dll" _
(ByVal hwnd%, ByVal lpsz0p$, ByVal lpszFile$, ByVal spszParam$, ByVal lpszDir$, ByVal fsShowcmd%)
Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Global Const SW_SHOWNORMAL = 1
'and attached to form1:
Private Sub cmdGo_Click()
Dim hwnd As Double, flag As Double
hwnd = GetForegroundWindow()
flag = Shellexecute(hwnd, "open", "C:\declaration.txt", "", _
"C:\", SW_SHOWNORMAL)
End Sub
I'm getting an error 6 overflow. the file C:\declaration.txt exists.
What am I doing wrong here? I was expecting the file to be displayed in a window.
The code I have is:
'In Module:
Declare Function Shellexecute% Lib "shell.dll" _
(ByVal hwnd%, ByVal lpsz0p$, ByVal lpszFile$, ByVal spszParam$, ByVal lpszDir$, ByVal fsShowcmd%)
Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Global Const SW_SHOWNORMAL = 1
'and attached to form1:
Private Sub cmdGo_Click()
Dim hwnd As Double, flag As Double
hwnd = GetForegroundWindow()
flag = Shellexecute(hwnd, "open", "C:\declaration.txt", "", _
"C:\", SW_SHOWNORMAL)
End Sub
I'm getting an error 6 overflow. the file C:\declaration.txt exists.
What am I doing wrong here? I was expecting the file to be displayed in a window.