Weavertje Posted August 5, 2018 Posted August 5, 2018 Hello All, Im totally new to autoit and playing with it so i learn. I want to insert a link into a button. So for example as i click on the button ''send'' that it goes to http://www.google.com Can anybody help me with that ? Just a test.au3
Danp2 Posted August 5, 2018 Posted August 5, 2018 Take a look at ShellExecute in the help file. Latest Webdriver UDF Release Webdriver Wiki FAQs
FrancescoDiMuro Posted August 5, 2018 Posted August 5, 2018 Hi @Weavertje, and welcome to the AutoIt forum Sure we can! To run a webpage, you could simply use _IECreate() function. Global $objIE = _IECreate("www.google.com") And you're done You can then manage all the stuffs related to a webpage ( clicks, user forms, DOM objects ), with all the others _IE* functions. Here you are your code slightly modified: Spoiler expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: Weaver #ce ---------------------------------------------------------------------------- #include <GUIConstantsEx.au3> #include <IE.au3> $frmHelloWorld = GUICreate("Still Learning", 280, 280) GUICtrlCreateLabel("Name", 8, 10) $Name1 = GUICtrlCreateInput("Put Name Here", 50, 8, 120) GUICtrlCreateLabel("Age", 8, 44) $time1 = GUICtrlCreateInput("Put Age Here", 50, 40, 120) GUICtrlCreateLabel("Country", 8, 78) $time1 = GUICtrlCreateInput("Put Country Here", 50, 73, 120) GUICtrlCreateLabel("....", 8, 112) $time1 = GUICtrlCreateInput("Nothing Yet", 50, 108, 120) GUICtrlCreateLabel("Sex", 8, 146) $male1 = GUICtrlCreateCheckbox("Male", 50, 140, 120) $female1 = GUICtrlCreateCheckbox ("Female", 50, 160, 120) $sendbutton = GUICtrlCreateButton("Send", 8, 200, 60) $stopbutton = GUICtrlCreateButton("Stop", 78, 200, 60) $resetbutton = GUICtrlCreateButton("Reset", 148, 200, 60) GUISetState(@SW_SHOW) ; This variable is used to see which messages the GUI send to the application ; ( click on a button, click on the Exit button, and so on... ) Global $intGUIMsg = 0 ; Internet Explorer variable Global $objIE While 1 $intGUIMsg = GUIGetMsg() Switch $intGUIMsg Case $sendbutton $objIE = _IECreate("www.google.com", 0, 1, 1, 1) If @error Then ConsoleWrite("Error while creating IE object. Error: " & @error & @CRLF) EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch Sleep(10) WEnd By the way, I suggest you to use Koda to build your GUIs. It's easier and faster. Hope that helps Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Weavertje Posted August 5, 2018 Author Posted August 5, 2018 Thanks for the help guys, i figured it out !
Weavertje Posted August 5, 2018 Author Posted August 5, 2018 So i see its opening in internet explorer now. i tried to open its with chrome. i know the line ShellExecute ("chrome.exe") is opening chrome. But how do i link that to a button ?
FrancescoDiMuro Posted August 5, 2018 Posted August 5, 2018 @Weavertje Case $sendbutton ShellExecute("chrome.exe www.google.com") Play with it before ask Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
careca Posted August 5, 2018 Posted August 5, 2018 I rather use GUICtrlSetOnEvent Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
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