brokenbeforetime Posted January 13, 2015 Posted January 13, 2015 Can anyone tell me why this code doesn't work? It wont run the EXITButton function when I click the system tray menu... It works with a form and a button but not a system tray menu... is it suppouse to? am I missing somthing? Thanks. #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode Opt("TrayMenuMode", 3) ; The default tray menu items will not be shown and items are not checked when selected. These are options 1 and 2 for TrayMenuMode. Local $idExit = TrayCreateItem("Exit") GUICtrlSetOnEvent($idExit, "EXITButton") While 1 Sleep(1000) ; Sleep to reduce CPU usage WEnd func EXITButton() Exit EndFunc
Moderators Solution SmOke_N Posted January 13, 2015 Moderators Solution Posted January 13, 2015 (edited) TraySetOnEvent Edit: Don't forget Opt("TrayOnEventMode", 1) Edited January 13, 2015 by SmOke_N brokenbeforetime 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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