vaurdan Posted February 27, 2006 at 03:38 PM Report #15766 Posted February 27, 2006 at 03:38 PM oi, Como faço para fazer ao caregar num botao abrir um determinado site no browser? e como faço para executar um executavel qualquer??? edit... ja sei a do executavel XD http://www.neopt.org <- O meu blog xD
Tiago Salgado Posted February 27, 2006 at 05:25 PM Report #15779 Posted February 27, 2006 at 05:25 PM Aqui tens uma forma, não sei se é a mais simples...mas é a única que tenho usado até agora. 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 Public Function OpenBrowser(ByVal URL As String) As Boolean Dim res As Long If InStr(1, URL, "http", vbTextCompare) <> 1 Then URL = "http://" & URL End If res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, _ vbNormalFocus) OpenBrowser = (res > 32) End Function Private Sub Command1_Click() Call OpenBrowser("www.portugal-a-programar.org") End Sub
vaurdan Posted February 27, 2006 at 05:41 PM Author Report #15781 Posted February 27, 2006 at 05:41 PM e ponho isso no Sub Private Command1_Click ? http://www.neopt.org <- O meu blog xD
Tiago Salgado Posted February 27, 2006 at 05:51 PM Report #15787 Posted February 27, 2006 at 05:51 PM e ponho isso no Sub Private Command1_Click ? Poes apenas a chamada da função no command1_click ou entao onde quiseres...o resto é a declaraçao da API e da funçao openbrowser()
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now