open a web page from vb app 
Author Message
 open a web page from vb app

Hi,

i have the following (i suppose simple) problem. I made a vb app that
consists of a menu system. Now i want to have that when a menu item is
selected, the browser is started (if it isn't already open) and it browses
to a specific page on a website. Does anyone have a few lines of code that
can do that?

Thx in advance

Regards,

Thomas



Fri, 31 Dec 2004 22:15:09 GMT  
 open a web page from vb app
Public Function OpenDoc(DocName As String) As Long

    Dim lHwnd As Long

    lHwnd = GetDesktopWindow()
    StartDoc = ShellExecute(lHwnd, "Open", DocName, "", "C:\", SW_SHOWNORMAL)

End Function

Now call OpenDoc("http://www.whatever.com") in the Click event.

Max Bolingbroke



Sat, 01 Jan 2005 13:58:03 GMT  
 open a web page from vb app
You'll need these declares too:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal LpszDir As String, ByVal FsShowCmd As Long) As Long

Private Declare Function GetDesktopWindow Lib "user32" () As Long

Max Bolingbroke

Quote:

> Hi,

> i have the following (i suppose simple) problem. I made a vb app that
> consists of a menu system. Now i want to have that when a menu item is
> selected, the browser is started (if it isn't already open) and it browses
> to a specific page on a website. Does anyone have a few lines of code that
> can do that?

> Thx in advance

> Regards,

> Thomas



Sat, 01 Jan 2005 13:58:38 GMT  
 open a web page from vb app
Hello,

If you want to open IE to open that page, you may use ShellExecute to do
so. If you want to embed a browser into your application, Microsoft
Internet controls are needed.

To call ShellExecute API,

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

Call ShellExecute(Form1.hwnd, "open", "http://www.microsoft.com",
vbNullString, vbNullString, &H0) ????

Hope this helps.

Regards,
Max
==========================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

|Newsgroups: microsoft.public.vb.controls.internet
|Subject: open a web page from vb app
|
|Hi,
|
|i have the following (i suppose simple) problem. I made a vb app that
|consists of a menu system. Now i want to have that when a menu item is
|selected, the browser is started (if it isn't already open) and it browses
|to a specific page on a website. Does anyone have a few lines of code that
|can do that?
|
|Thx in advance
|
|Regards,
|
|Thomas
|
|
|



Sat, 01 Jan 2005 16:44:12 GMT  
 open a web page from vb app
Hello,

If you want to open IE to open that page, you may use ShellExecute to do
so. If you want to embed a browser into your application, Microsoft
Internet controls are needed.

To call ShellExecute API,

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

Call ShellExecute(Form1.hwnd, "open", "http://www.microsoft.com",
vbNullString, vbNullString, &H0) ????

Hope this helps.

Regards,
Max
==========================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

|Newsgroups: microsoft.public.vb.controls.internet
|Subject: open a web page from vb app
|
|Hi,
|
|i have the following (i suppose simple) problem. I made a vb app that
|consists of a menu system. Now i want to have that when a menu item is
|selected, the browser is started (if it isn't already open) and it browses
|to a specific page on a website. Does anyone have a few lines of code that
|can do that?
|
|Thx in advance
|
|Regards,
|
|Thomas
|
|
|



Sat, 01 Jan 2005 16:44:12 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Passing Data from VB App Text Box to a Web Page Text Box

2. How to open web pages from VB application

3. QUEST: Launch a Web Page from Within VB App

4. Running a VB app from a web page

5. W B Ctl - Comms From Web Page To VB App

6. pass a form from web page to web page

7. pass a form from web page to web page

8. Save as web page while creating an app in visual basic 6.0 for visio

9. calling web page from windows app

10. Thread Exception-WinForm app executed from Web page

11. need app that submits form on web page

12. How to pass a web page to an app from IE

 

 
Powered by phpBB® Forum Software