mr-es335 Posted Thursday at 04:55 PM Posted Thursday at 04:55 PM Good day, I hope that the day finds each of you very well! I need to ensure that the GUI is properly exited! Here is my current script: expandcollapse popup; ----------------------------------------------- #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $ExitSACGui ; ----------------------------------------------- LiveGui() ; ----------------------------------------------- Func LiveGui() $ExitSACGui = GUICreate("", 75, 23, 630, 50, $WS_POPUP, $WS_EX_TOPMOST) GUISetFont(14, 800, 0, "Calibri") GUISetBkColor(0x3D3D3D) ; ----------------------------------------------- Local $sColRow = GUICtrlCreateLabel(" Exit SAC", 0, 0, 75, 23, $SS_CENTER) GUICtrlSetColor(-1, 0xFFFFFF) ; ----------------------------------------------- GUISetState(@SW_SHOW) ; ----------------------------------------------- While 1 Switch GUIGetMsg() Case $sColRow ExitSACTTA() GUIDelete($ExitSACGui) Exit EndSwitch WEnd EndFunc ;==>LiveGui ; ----------------------------------------------- Func ExitSACTTA() ExitSAC() LaunchTTA() EndFunc ;==>ExitSACTTA ; ----------------------------------------------- Func ExitSAC() Local $sSrcPath1a = "C:\RML\SAC\SAC64.exe" Local $sSrcPath1b = "SAC64.exe" Local $PID = 0 ; ----------------------------------------------- ProcessClose($sSrcPath1a) $PID = ProcessExists($sSrcPath1b) If $PID Then ProcessClose($PID) EndFunc ;==>ExitSAC ; ----------------------------------------------- Func LaunchTTA() Local $sSrcPath = "C:\Windows\toggleTaskbarAutohide.exe" ; ----------------------------------------------- Run($sSrcPath) Sleep(100) EndFunc ;==>LaunchTTA ; ----------------------------------------------- As always...any assistance in this matter would be greatly appreciated! Thank you! mr-es335 Sentinel Music Studios
Solution argumentum Posted Thursday at 05:57 PM Solution Posted Thursday at 05:57 PM 1 hour ago, mr-es335 said: Good day, I hope that the day finds each of you very well! I need to ensure that the GUI is properly exited! Here is my current script: expandcollapse popup; ----------------------------------------------- #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- Global $ExitSACGui ; ----------------------------------------------- LiveGui() ; ----------------------------------------------- Func LiveGui() $ExitSACGui = GUICreate("", 75, 23, 630, 50, $WS_POPUP, $WS_EX_TOPMOST) GUISetFont(14, 800, 0, "Calibri") GUISetBkColor(0x3D3D3D) ; ----------------------------------------------- Local $sColRow = GUICtrlCreateLabel(" Exit SAC", 0, 0, 75, 23, $SS_CENTER) GUICtrlSetColor(-1, 0xFFFFFF) ; ----------------------------------------------- GUISetState(@SW_SHOW) ; ----------------------------------------------- While 1 Switch GUIGetMsg() Case $sColRow ExitSACTTA() GUIDelete($ExitSACGui) Exit EndSwitch WEnd EndFunc ;==>LiveGui ; ----------------------------------------------- Func ExitSACTTA() ExitSAC() LaunchTTA() EndFunc ;==>ExitSACTTA ; ----------------------------------------------- Func ExitSAC() Local $sSrcPath1a = "C:\RML\SAC\SAC64.exe" Local $sSrcPath1b = "SAC64.exe" Local $PID = 0 ; ----------------------------------------------- ProcessClose($sSrcPath1a) $PID = ProcessExists($sSrcPath1b) If $PID Then ProcessClose($PID) EndFunc ;==>ExitSAC ; ----------------------------------------------- Func LaunchTTA() Local $sSrcPath = "C:\Windows\toggleTaskbarAutohide.exe" ; ----------------------------------------------- Run($sSrcPath) Sleep(100) EndFunc ;==>LaunchTTA ; ----------------------------------------------- As always...any assistance in this matter would be greatly appreciated! Thank you! Yes it is. Why are you asking ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
argumentum Posted Friday at 03:43 AM Posted Friday at 03:43 AM 1 hour ago, SmileFace123 said: Gui delete? Does sound better than "GUI destroy". SOLVE-SMART and mr-es335 2 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
water Posted Friday at 08:06 AM Posted Friday at 08:06 AM @SmileFace123 Could you please post full sentences? I see you are new on this forum. The goal of this forum is to help other users with their problems. Two word sentences do not help very much mr-es335 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
mr-es335 Posted Saturday at 01:15 PM Author Posted Saturday at 01:15 PM argumentum, "Yes it is. Why are you asking ?" Just wanted to ensure that I was on the "right tracks"!!! Thanks again!! mr-es335 Sentinel Music Studios
water Posted Saturday at 01:47 PM Posted Saturday at 01:47 PM When you learn to ride a bike, you don't ask your parents every 100 metres whether you're doing it right. As long as you don't fall, you're doing it right. It's the same with programming. If it works, then you've done a lot of things right. Maybe not efficiently or according to all the rules of programming, but it works. You've been working with AutoIt long enough that you should have this confidence in your own abilities and not have to ask after every 5 lines of code. Have more confidence! If it works, then it's good. If you get wrong results or error messages, that's the time to ask. Just my 2 cents worth! Written with the help of DeepL.com translator Melba23, argumentum and SOLVE-SMART 2 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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