[Done] Is a Right-Click Menu for System Tray Icon Possible?

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

[Done] Is a Right-Click Menu for System Tray Icon Possible?

Post by jpuziano » Thu Mar 30, 2006 4:12 am

Hi Marcus,

I don't think this is currently possible (if it is, please show us how) but could the ability to minimize a dialog to the system tray be added?

Or perhaps this would apply against the macro as a whole... not just a dialog? I would like to add this to a compiled macro, be able to minimize it to the system tray and perhaps even have "System Tray Menu Items" like maximize (Show), Exit, Help, About and maybe others that could be defined.

Are there any possibilities here?
Last edited by jpuziano on Mon Nov 21, 2011 8:20 pm, edited 5 times in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Nov 26, 2007 4:40 pm

Hi Marcus and Everyone,

A bit more background...

Today, we compile and run a macro and the existence of that icon in the System Tray tells the user the macro is running. Tomorrow, if we could add this, the user could right-click the System Tray icon to select from a menu of choices like Exit (shut down the macro), Show (open the macro dialog to check status, change configuration, initiate a new action, etc.), Help could open Help screens, About, etc.

This would be very nice for macros that run for a user during the day in the background. The user could control the macro straight from the system tray right-click menu.

Anyone have any thoughts on how to add System Tray support? Possible using Window API calls?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jan 18, 2010 8:32 am

I've added this to the list of things to consider.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Jan 18, 2010 5:58 pm

mtettmar wrote:I've added this to the list of things to consider.
Thanks Marcus.

I've also added below some out-takes from this post: compiled script icon questions in support of this request and the one from EnderFFX.
EnderFFX wrote:
jpuziano wrote:
EnderFFX wrote:On the icon bar of at the bottom right of most screen, my icon flashes and then the MJT icon flashes. Is it possible to change that so I can set between two different icons so the MJTNet logo doesn't appear?
mtettmar wrote:I guess what you want is to specify an alternative icon so that you can have your own "flashing" animation. And/or an option to disable the flashing altogether.
Hi Marcus,

I'd like to second this enhancement request, thanks EnderFFX for posting about it.
  • 1) ability to specify alternative icon to have our own "flashing" animation

    2) option to disable the flashing altogether
Here are some further ideas for added functionality you may want to consider while you're at it:
  • 3) ability to "programmatically" specify the alternative icon would allow us to communicate back to the user by dynamically changing what alt icon is active while the compiled macro runs... a red one might indicate an error condition that needs attention, a green one might indicate all is well, etc.

    4) ability to "programmatically" turn the icon flashing on or off as the program runs... again to communicate something to the user... as the flashing will draw the eye much more than just a steady icon.

    5) * ability to code a right click menu for the system tray icon, see existing enhancement request:

    [Open] Is a Right-Click Menu for System Tray Icon Possible?
* Sadly, if I want this ability today, I have to use something other than Macro Scheduler. Almost any app these days gives you a right click menu on the system tray icon... so it would be nice to have this same ability in our compiled macros. Marcus please consider adding this...
Agree with everything said here.
Rain wrote:I'm with jpuziano on this. The ability to change or disable the alternative icon and a right click menu would be a great addition.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Nov 21, 2011 7:42 pm

Menu for System Tray Icon is now possible with version 13.
PopupMenu>X,Y,ItemList,result

Creates and displays a simple pop up menu at the specified X,Y position and returns the index of the item selected by the user.

X and Y take a screen X,Y position

ItemList is a semi-colon delimited list of captions

result is the return value and will contain the zero based index of the item the user selected


Example

Let>Items=Open;Close;About;Exit

GetCursorPos>X,Y

PopupMenu>X,Y,Items,res

MessageModal>You selected item: %res%
Thank you Marcus for listening to our suggestions.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Nov 21, 2011 8:20 pm

Rain wrote:Menu for System Tray Icon is now possible with version 13.
Thank you Marcus for listening to our suggestions.
Yup it sure is... so I just updated the subject line of this post from Open to Done... and yes... thanks Marcus, much appreciated.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

rohcro
Newbie
Posts: 5
Joined: Tue Apr 26, 2011 2:21 am

Post by rohcro » Sat Dec 10, 2011 11:42 am

Rain wrote:Menu for System Tray Icon is now possible with version 13.
Example

Let>Items=Open;Close;About;Exit

GetCursorPos>X,Y

PopupMenu>X,Y,Items,res

MessageModal>You selected item: %res%
How do you use it so the menu appears only when you click on the System Tray Icon?

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Sat Dec 10, 2011 4:08 pm

Hi rohcro,
Here is an example

Code: Select all

//Add Tray icon
Let>IconFile=C:\MyIcon.ico
AddTrayIcon>%IconFile%,MyTrayIcon,Left click to show popup menu
//Add Tray icon Handler to Show Popup Menu
AddTrayHandler>MyTrayIcon,OnClick,ShowPopupMenu


Label>ActionLoop
Wait>0.1
Goto>ActionLoop


SRT>ShowPopupMenu
Let>Items=Cancel;-;Exit
GetCursorPos>X,Y
PopupMenu>X,Y,Items,menres

If>menres=0
MessageModal>Cancel Clicked
Endif

If>menres=2,Quit
END>ShowPopupMenu


SRT>Quit
  Exit>1
END>Quit

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts