Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > open internet site


Reply
 
Thread Tools Display Modes
  #1  
Old 06-29-2003, 09:10 AM
solveon solveon is offline
Centurion
 
Join Date: Apr 2003
Posts: 110
Default open internet site


How would i be able to open an internet site when i click on a button.
for example this site.
I know i have to use the shellexecute API and i tried this code

Code:
ShellExecute hwnd, "open", "http://www.mysite.com", vbNullString, vbNullString, conSwNormall

but then it gives an error variable not defined.
Reply With Quote
  #2  
Old 06-29-2003, 09:16 AM
Csharp's Avatar
Csharp Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

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 Private Const SW_NORMAL As Long = 1 Private Sub Command1_Click() ShellExecute Me.hwnd, "open", "http://google.com", vbNullString, vbNullString, SW_NORMAL '/// this makes your exsisting browser navigate to the new page if you have a browser open. '///you must have the ShellExecute referenced on your project like above^^^ End Sub Private Sub Command2_Click() Shell "explorer.exe http://google.com", vbNormalFocus '///this opens a new instance of internet explorer. '///you dont need the shellexecute api referenced this way. End Sub
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner help with timers. School program... KreeZiE General 18 04-24-2003 04:45 PM
Makin a nice little program! Decontain Communications 3 04-11-2003 02:54 AM
Open text file on the internet bibiteinfo General 3 04-05-2003 09:27 AM
how to open M. Internet Explorer with an URL? aldiegof General 3 03-02-2001 08:04 PM
how can i open a port and leave open rudy Communications 1 12-11-2000 08:26 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->