-
July 27th, 2002, 03:29 PM
#1
Executing a shortcut
How can I execute a shortcut? I tried it whit shell but i get error n 5 ? Please help me
Bert Willekens,
-
July 27th, 2002, 08:58 PM
#2
Code:
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
Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, "Open", "C:\Windows\Desktop\Outlook Express.lnk", vbNullString, "", SW_SHOWNORMAL
End Sub
-
July 28th, 2002, 03:16 AM
#3
MKSa's answer will only work with certain system settings, not to mention a specific desktop icon. Here is the way to use whatever the default browser happens to be.
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
URL = "http://www.codeguru.com/"
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|