# Re: 再问 shell....................................

Posted by jeffrey on September 28, 1998 at 07:51:53:

In Reply to: 再问 shell.................................... posted by Chino on September 27, 1998 at 15:54:16:

: 在98中,只要在开始->执行,key in : http://www.hinet.net 即可以其98中
: 预设之流览器开启,key in : mailto:nolover@ms1.url.com.tw , 即可以其98中
: 之预设之Mail 程式开启新邮件,

: 用vb中之shell () 却无和其有一样的效果,要如何作呢...???

改成使用API ShellExecute:

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

Public Function OpenURL(ByVal URL As String)
Dim hwnd
Dim res&
Dim obj As Object
res& = ShellExecute(hwnd, "open", URL, vbNullString, CurDir$, SW_SHOW)
End Function

然后用 OpenUrl("http://xxxxxx") 就可以了

Follow Ups: