
Please help with executing shortcuts from VB4 Enterprise
Dan-
Try either one of these.
_____snip-____________________________________
Option Explicit
Private 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
Private Sub Command1_Click()
Dim ret&
ret = ShellExecute(Me.hwnd, "", _
"c:\windows\desktop\isp.lnk", _
"", "", 1)
' This should work, too
'ret = Shell("rundll32.exe rnaui.dll,RnaDial " & "ISP", 1)
End Sub
_____________________________snip_________________
--
***********************************************************
http://www.tiac.net/users/lvasseur/freeware.html
Resume, etc:
http://www.tiac.net/users/lvasseur/index.html
"Recompense injury with justice, and recompense
kindness with kindness." Confucius
**********************************************************
Quote:
> Howdy all, hope you have time for a question for a newbie.
> Specific question: Why won't VB execute a shortcut, just like any other
> program with the Shell function and AppActivate?
> Application: I'm trying to write a program to use to close down faxworks
> and open dial-up networking to get on the Internet, and then do the
> opposite when I log off. To close faxworks, I have put the focus on that
> window and SendKeys Alt F4 to faxworks. Then I should be able to open
> dial-up networking by executing the shortcut on my desktop to my internet
> connection:
> MyAppID = Shell("c:\windows\desktop\isp.lnk", 1)
> AppActivate MyAppID
> where isp.lnk is the name of the shortcut to the internet connection in
the
> dial-up networking system folder.
> Unfortunately when I try this, I get a Run-time error 5: Invalid
procedure
> call.
> Any help will be greatly appreciated. Please send all mail to
> Dan Magidson