SerLanceloth Posted March 24, 2016 Posted March 24, 2016 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
AutoBert Posted March 24, 2016 Posted March 24, 2016 (edited) Just like this: #include <GUIConstantsEx.au3> Example() 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 ExitLoop Case $idYT $iPID=ShellExecute('https://www.youtube.com/') EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) ; Close the Webbrowser process using the PID returned by ShellExecute. If $iPID Then ProcessClose($iPID) EndFunc ;==>Example Edited March 24, 2016 by AutoBert
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