Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / October 2004



Tip: Looking for answers? Try searching our database.

How to open a shortcut(*.url) in my Vb Program

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
babbitt - 31 Oct 2004 10:38 GMT
Hi,All
I want to make a super-link in my vb Form.
Hi All,
I read sevral articles about it.But it doesn't work on my machine.
Maybe the code at the bottom of this page  can work in win98,but I use
Windows XP instead.

Thanks!

Call ShellExecute(form1.hwnd, "open", "http://www.babbitt.cn", vbNullString,
vbNullString, &H0)
nrford - 31 Oct 2004 13:37 GMT
Have you tried looking at these? --

http://www.google.com/search?sourceid=navclient&ie=UTF-8&q=%22default+browser%22+vb6

NFord

> Hi,All
> I want to make a super-link in my vb Form.
[quoted text clipped - 8 lines]
> vbNullString,
> vbNullString, &H0)
babbitt - 31 Oct 2004 19:37 GMT
You are so helpful.I try it,but it doesn't work on my machine.I know it
works when I use win98 or Win200.
Maybe we should mind a new method with WinXP.Have you ever tried it in a
WinXP System.

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

' Open the default browser on a given URL
' Returns True if successful, False otherwise

Public Function OpenBrowser(ByVal URL As String) As Boolean
   Dim res As Long

   ' it is mandatory that the URL is prefixed with http:// or https://
   If InStr(1, URL, "http", vbTextCompare) <> 1 Then
       URL = "http://" & URL
   End If

   res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, _
       vbNormalFocus)
   OpenBrowser = (res > 32)
End Function

> Have you tried looking at these? --

http://www.google.com/search?sourceid=navclient&ie=UTF-8&q=%22default+browser%22+vb6

> NFord
>
[quoted text clipped - 10 lines]
> > vbNullString,
> > vbNullString, &H0)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.