Jump to content

Button to default browser

Recommended Posts


hello guys, im looking for a way to open a new tab on the default browser to a certain URL 

for example, all lets say a button that opens youtube or any other webpage when you click on it

thank you all for your assist

Share this post

Link to post
Share on other sites

Just like this:

#include <GUIConstantsEx.au3>


Func Example()
    ; Create a GUI with various controls.
    Local $hGUI = GUICreate("Example", 300, 200)

    ; Create a button control.
    Local $idYT = GUICtrlCreateButton("Run Youtube", 120, 170, 85, 25)
    Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25)

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGUI)

    Local $iPID = 0

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $idClose

            Case $idYT

    ; Delete the previous GUI and all controls.

    ; Close the Webbrowser process using the PID returned by ShellExecute.
    If $iPID Then ProcessClose($iPID)
EndFunc   ;==>Example


Edited by AutoBert

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.