narciso Posted May 23, 2007 Share Posted May 23, 2007 (edited) Hello, Is it possible to change the behavior of a compiled script Tray Icon such that upon clicking it, it does not show any menu but performs a predefined function, like e.g. exiting the program? Edited May 23, 2007 by narciso Warmly,Narciso Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 23, 2007 Share Posted May 23, 2007 Hello,Is it possible to change the behavior of a compiled script Tray Icon such that upon clicking it, it does not show any menu but performs a predefined function, like e.g. exiting the program?Hi,yes it is. TrayMenuModeSo long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
narciso Posted May 23, 2007 Author Share Posted May 23, 2007 Hi,yes it is. TrayMenuModeSo long,MegaWould you please give an example? I suspect you mean TrayMenuMode 2, but I cannot figure out how to use it. Let's asume I want the script to Exit if the user has clicked (left or right mouse button) on the Trai Icon. Warmly,Narciso Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 23, 2007 Share Posted May 23, 2007 HI, #Include <Constants.au3> Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown. TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = $TRAY_EVENT_PRIMARYDOWN MsgBox(0, "$TRAY_EVENT_PRIMARYDOWN", "EXIT", 2) Exit (0) Case $msg = $TRAY_EVENT_SECONDARYDOWN MsgBox(0, "$TRAY_EVENT_SECONDARYDOWN", "EXIT", 2) Exit (0) EndSelect WEnd Exit So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
narciso Posted May 25, 2007 Author Share Posted May 25, 2007 HI, #Include <Constants.au3> Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown. TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = $TRAY_EVENT_PRIMARYDOWN MsgBox(0, "$TRAY_EVENT_PRIMARYDOWN", "EXIT", 2) Exit (0) Case $msg = $TRAY_EVENT_SECONDARYDOWN MsgBox(0, "$TRAY_EVENT_SECONDARYDOWN", "EXIT", 2) Exit (0) EndSelect WEnd Exit So long, Mega Thx Warmly,Narciso Link to comment Share on other sites More sharing options...
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