ActualAkshay Posted February 6, 2013 Share Posted February 6, 2013 Is it possible to show different menus for left click and right on tray icon simultaneously, if yes, please tell how, hoping for a reply soon Link to comment Share on other sites More sharing options...
Exit Posted February 7, 2013 Share Posted February 7, 2013 expandcollapse popup#include <constants.au3> #include <Misc.au3> Opt("TrayMenuMode", 1) Opt("TrayOnEventMode", 1) ;0=disable, 1=enable Global $traymode = "Primary", $Item1, $Item2 $Item1 = TrayCreateItem("Item 1") TrayItemSetOnEvent(-1, "_Tray") $Item2 = TrayCreateItem("Item 2") TrayItemSetOnEvent(-1, "_Tray") $exit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "_Tray") TraySetClick(18) TraySetState() Exit _Main() Func _Main() While Sleep(10) If _IsPressed("01") Then $traymode = "Primary" TrayItemSetText($Item1, $traymode & " 1") TrayItemSetText($Item2, $traymode & " 2") EndIf If _IsPressed("02") Then $traymode = "Secondary" TrayItemSetText($Item1, $traymode & " 1") TrayItemSetText($Item2, $traymode & " 2") EndIf WEnd EndFunc ;==>_Main Func _Tray() TrayItemSetState(@TRAY_ID, $TRAY_UNCHECKED) Local $Text Switch @TRAY_ID & $traymode Case $Item1 & "Primary" $Text = "Primary 1" Case $Item1 & "Secondary" $Text = "Secondary 1" Case $Item2 & "Primary" $Text = "Primary 2" Case $Item2 & "Secondary" $Text = "Secondary 2" Case Else Exit MsgBox(262144, "", @LF & " Exit" & @LF, 1) EndSwitch MsgBox(262144, "", @LF & $Text & " pressed" & @LF, 2) EndFunc ;==>_Tray App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
ActualAkshay Posted February 8, 2013 Author Share Posted February 8, 2013 (edited) Thank you!! but is there a way by which it can be done without using _IsPressed() in the sleep(10) loop? Edited February 8, 2013 by ActualAkshay 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