Go to a web pages from Visual Basic v5 
Author Message
 Go to a web pages from Visual Basic v5

I created a form with, for example, five button, each button run Internet
Explorer followed by the URL to connect to:

explorer " http://www.*-*-*.com/ ;

i execute the command with shell() function.

While this work fine with Windows98, it does NOT WORK AT ALL with windows95.

Howq can I open an IE windows and let it go to the specified web page on the
internet?

Advanced 10x to all for help!!!

(please, if you can, answer on e-mail too, since I can't check news too
often!)



Sat, 04 Aug 2001 03:00:00 GMT  
 Go to a web pages from Visual Basic v5
On Tue, 16 Feb 1999 15:24:37 +0100, "Andre' Vellori"

Quote:

>I created a form with, for example, five button, each button run Internet
>Explorer followed by the URL to connect to:

>explorer "http://www.myweb.it/somepage.htm"

>i execute the command with shell() function.

Instead of Shell to explorer, try shell to the command "start"
followed by your URL...

Shell "start http://www.myweb.it/somepage.htm",vbHide

This should start whatever the default web browser is on Win95 or 98.
Works on my system.  If the user has Netscape, not explorer, this will
still work...
Zak  



Sat, 04 Aug 2001 03:00:00 GMT  
 Go to a web pages from Visual Basic v5
On Tue, 16 Feb 1999 15:24:37 +0100, "Andre' Vellori"

Quote:

>I created a form with, for example, five button, each button run Internet
>Explorer followed by the URL to connect to:

>explorer "http://www.myweb.it/somepage.htm"

>i execute the command with shell() function.

>While this work fine with Windows98, it does NOT WORK AT ALL with windows95.

>Howq can I open an IE windows and let it go to the specified web page on the
>internet?

It's not linked to the main site yet, but I've put up a function to do
this at http://www.optionexplicit.com/code_vault/LaunchURL.html

--Jekke
===
I own enough crummy programming books to bury a small
horse.  Learn Visual C++ while you learn from my
mistakes:
http://www.optionexplicit.com/Books/c_mfc_win.html



Sat, 04 Aug 2001 03:00:00 GMT  
 Go to a web pages from Visual Basic v5
try shell(start.exe <url>)


Quote:
>I created a form with, for example, five button, each button run Internet
>Explorer followed by the URL to connect to:

>explorer "http://www.myweb.it/somepage.htm"

>i execute the command with shell() function.

>While this work fine with Windows98, it does NOT WORK AT ALL with
windows95.

>Howq can I open an IE windows and let it go to the specified web page on
the
>internet?

>Advanced 10x to all for help!!!

>(please, if you can, answer on e-mail too, since I can't check news too
>often!)



Sat, 04 Aug 2001 03:00:00 GMT  
 Go to a web pages from Visual Basic v5
Andre,

Ignore the examples using Start. They do not work on all machines.

Use:

http://home.earthlink.net/~butlerbob/vb/tasks/shellany.htm

Matthew



Quote:
> I created a form with, for example, five button, each button run Internet
> Explorer followed by the URL to connect to:

> explorer "http://www.myweb.it/somepage.htm"

> i execute the command with shell() function.

> While this work fine with Windows98, it does NOT WORK AT ALL with
windows95.

> Howq can I open an IE windows and let it go to the specified web page on
the
> internet?

> Advanced 10x to all for help!!!

> (please, if you can, answer on e-mail too, since I can't check news too
> often!)



Sat, 04 Aug 2001 03:00:00 GMT  
 Go to a web pages from Visual Basic v5
Here's how I do it:

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 Declare Function FindExecutable Lib "shell32.dll" Alias _
   "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As _
   String, ByVal lpResult As String) As Long

Public Sub ShowWebPage(ParentHwnd As Long, URL As String)

    On Error GoTo ShowWebPage_Error

    'this procedure determines which browser the user has installed by
creating a dummy
    'html file then using the windows api to check it's associations.
    'It then launches that browser and uses it to display the passed
in URL

    Dim sHTMLFile   As String
    Dim RetVal      As Long
    Dim BrowserExec As String * 255
    Dim Filenumber As Integer
    Dim Dummy       As String

    ' First, create a known, temporary HTML file      BrowserExec =
Space(255)

    sHTMLFile = GetTempDirectory + "temphtm.HTM"

    ' Get unused file number
    Filenumber = FreeFile

    ' Create temp HTML file
    Open sHTMLFile For Output As #Filenumber
    Write #Filenumber, "<HTML> <\HTML>"
    Close #Filenumber

    ' Then find the application associated with it
    RetVal = FindExecutable(sHTMLFile, Dummy, BrowserExec)

    BrowserExec = Trim(BrowserExec)

     ' If an application is found, launch it!
    If RetVal <= 32 Or IsEmpty(BrowserExec) Then ' Error
        MsgBox "Could not find an Internet Browser", vbExclamation,
"Cannot show Web page"
    Else
        RetVal = ShellExecute(ParentHwnd, "open", BrowserExec, _
                URL, Dummy, SW_SHOWNORMAL)
        If RetVal <= 32 Then        ' Error
            MsgBox "Web Page not Opened", vbExclamation, "Web URL
Failed"
        End If
    End If

      Kill sHTMLFile

ShowWebPage_Exit:

    Exit Sub

ShowWebPage_Error:

    Err.Raise Err, "CLibrary.ShowWebPage"

    Resume ShowWebPage_Exit

End Sub



Mon, 06 Aug 2001 03:00:00 GMT  
 Go to a web pages from Visual Basic v5


Fri, 19 Jun 1992 00:00:00 GMT  
 Go to a web pages from Visual Basic v5
Hi Here is some simple 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

**  'on a click this will launch the default email app.

vbNullString, _
                        vbNullString, vbNormalFocus)

**  'on a click this will launch the default broswer
Call ShellExecute(0&, vbNullString, "http://www.AgendumSoftware.com",
vbNullString, _
                        vbNullString, vbNormalFocus)

--
Sincerely,

Todd B -  Agendum Software
** FREE Developer tools for download!  NEW release -  AG Fastform layout
tool just released!
http://www.AgendumSoftware.com


Quote:
>I created a form with, for example, five button, each button run Internet
>Explorer followed by the URL to connect to:

>explorer "http://www.myweb.it/somepage.htm"

>i execute the command with shell() function.

>While this work fine with Windows98, it does NOT WORK AT ALL with
windows95.

>Howq can I open an IE windows and let it go to the specified web page on
the
>internet?

>Advanced 10x to all for help!!!

>(please, if you can, answer on e-mail too, since I can't check news too
>often!)



Tue, 07 Aug 2001 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Go to a web pages from Visual Basic v5

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

3. Visual Basic & Web Pages

4. Web pages using Visual Basic

5. New Visual Basic Web Page

6. Visual Basic On Line User Group Web Page

7. Visual Basic Web Page Counter...

8. using textrange in visual basic to parse web page

9. Using Visual Basic 5.0 for Web Pages

10. Multiple dbCombo Boxes in Visual Basic v5.00

11. Help with Visual Basic v5/6

12. inserting pictures into visual basic v5.0

 

 
Powered by phpBB® Forum Software