astralmaster
astralmaster

Reputation: 2465

Open URL without Webbrowser or Inet control vb6

Is there a way to open a URL in VB6 application without using Webbrowser or MSInet components? thanks

Upvotes: 0

Views: 4068

Answers (2)

Mark Bertenshaw
Mark Bertenshaw

Reputation: 5689

No. VB6 does not have any intrinsic means of displaying a web page in an application. You have to use a third party control. On the other hand, this shouldn't be a problem, because you are essentially using a component of Microsoft Internet Explorer. In fact, you should not be distributing this control, because you would likely damage the end user's Windows installation.

Upvotes: 1

Akhilesh B Chandran
Akhilesh B Chandran

Reputation: 6608

If you just want to open the URL in a browser window, then use ShellExecute: http://support.microsoft.com/kb/224816

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 r As Long
   r = ShellExecute(0, "open", "http://www.microsoft.com", 0, 0, 1)
End Sub

This will open the URL in the default browser.

Otherwise, if you need to display the webpage inside your app, use the WebBrowser control.

Upvotes: 7

Related Questions