MichaelCrawley Posted March 15, 2023 Posted March 15, 2023 I have excatly 2 months of experience in AUTIOIT and I am learning when you think have everything you need you quickly learn you don't. I have been working on this project that has a small gui that has 5 buttons one button will open a web page, one closes the web page, one opens and excel file, one to close the excel file, and the final button exits the GUI. I don't really want to post my entire code because I am learning as I go and I would rather figure out the small errors out on my own. When I first started working in AutoIT I asked question about a toggle feature and someone helped with the code. I still want to use the toggle feature My Goal is when I CLICK close the QCDM I want the toggle feature to stop. I can't figure out how to do that. Any help would be nice. Button to Open a the webpage and to toggle ;button to open QCDM Case $idButton_QCDM ;Calls webpage webPage() Sleep(1000) openScreen() Web page will close properly but the "Toggle" is still running ;Closes Chrome Case $idButton_CLOSEQCDM ;Closes Chrome WinClose("Amazon.com. Spend less. Smile more. - Google Chrome","") exitChrome() My Function to open chrome Func openScreen() ;max size of window @sw_maxmimize WinSetState("Musical Instruments For Sale - New & Used Music Gear | Reverb - Google Chrome", "", @SW_MAXIMIZE) ;sleeps for 3 seconds Sleep (3000) AdlibRegister("toggle", 3000) EndFunc This is my Toggle Function Func Toggle() ;==>Toggle between web pages ConsoleWrite('@@ (8) :(' & @MIN & ':' & @SEC & ') Toggle()' & @CR) ;### Trace Function Static $bFirst = True WinActivate(@SW_MAXIMIZE) If $bFirst Then Send("^1") Else Send("^2") EndIf $bFirst = Not $bFirst EndFunc
Solution Danp2 Posted March 15, 2023 Solution Posted March 15, 2023 Take a look at AdlibUnRegister. Latest Webdriver UDF Release Webdriver Wiki FAQs
MichaelCrawley Posted March 15, 2023 Author Posted March 15, 2023 (edited) Thank you! Quote Func exitChrome() $runString = StringFormat("TASKKILL /F /IM chrome.exe /T") $run = Run($runString, "", @SW_HIDE) AdlibUnRegister ("toggle") EndFunc Edited March 15, 2023 by MichaelCrawley
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