|
|
|

|

|
Dicas
|

|
Visual Basic (Internet)
|
|
 |
Título da Dica: Acionar o navegador padrão em um URL específico
|
 |
|
|
Postada em 14/8/2000 por Webmaster
webmaster@vbweb.com.br
>> Dica 1
'Na seção de declarações coloque: 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_SHOWNORMAL As Long = 1
'Coloque um botão em um form e adicione o código:
Private Sub Command1_Click() Dim i As Long i = ShellExecute (hwnd,"open", _ "http://www.vbweb.cjb.net", _ "", "", SW_SHOWNORMAL) End Sub
>> Dica 2 'Clique em Project - References e selecione Microsoft internet Controls e então experimente o código a seguir:
Private Sub Command1_Click() On Error GoTo Err_IE Dim objIE4 As SHDocVw.InternetExplorer Set objIE4 = New SHDocVw.InternetExplorer With objIE4 .Navigate2 "www.vbweb.cjb.net" .Visible = True End With Set objIE4 = Nothing Exit Sub Err_IE: Set objIE4 = Nothing End Sub
>> Dica 3
Ou então experimente este código (NÃO funca em Win NT): Shell "start.exe http://www.vbweb.cjb.net", vbHide
|
|
|
|

|