Page 1 of 1
Windows system tray icon
Posted: Tue Dec 12, 2017 11:18 am
by rblackmore245
I am unable to find any correct upto date information on how to create a system tray icon for my app when its minimized and then listen out for the event of a double click on the icon to restore the app window.
Re: Windows system tray icon
Posted: Tue Dec 12, 2017 1:42 pm
by AndyP
If you are using a standard window then this should be automatically taken care of.
The icon will be your exe application icon.
If you are using a custom window shape then you can use this
In the mimimize button script:
on mouseUp
--reset the windowshape to default and add a minimise button, required due to iconic command bug
set the decorations of this stack to "minimize"
set the iconic of this stack to true
end mouseUp
In the stack script:
In the stack script:
on unIconifyStack
-- revert to original window shape, doing so automatically removes the minimise decoration
set windowShape of me to <your background image id>
end unIconifyStack
Re: Windows system tray icon
Posted: Tue Dec 12, 2017 3:15 pm
by shaosean
rblackmore245 wrote: ↑Tue Dec 12, 2017 11:18 am
I am unable to find any correct upto date information on how to create a system tray icon for my app when its minimized and then listen out for the event of a double click on the icon to restore the app window.
I don't think there is the ability to put an icon in the system tray, but it is something that one could look at doing with LiveCode Builder..
Re: Windows system tray icon
Posted: Tue Dec 12, 2017 3:18 pm
by bogs
The wording does make it hard to tell if he is talking about the actual 'system tray' or the 'task bar' in this case. I believe Andy's reply was referring to the second one, but as I said, the description of what is actually trying to be accomplished sounds confusing.
I think the system tray is supported in some fashion without LCB due to threads like
this one.
Re: Windows system tray icon
Posted: Tue Dec 12, 2017 3:21 pm
by shaosean
Actually, his wording does make sense.. Way back in the day, when I had used Windows and WinAMP, WinAMP had the ability to minimize to the system tray (not the task bar) and then double-clicking the system tray icon would maximize it..
Re: Windows system tray icon
Posted: Tue Dec 12, 2017 3:24 pm
by bogs
I was just trying to say the wording is a bit confusing, the fact that 2 people put up 2 replies about 2 different things tends to bear that out
As I was editing my above post, I came across this thread in the link ->
bogs wrote: ↑Tue Dec 12, 2017 3:18 pm
I think the system tray is supported in some fashion without LCB due to threads like
this one.
I also came across
this from Key Ray's site, but it was written in trayscript.
*Edit - I also came across
this from the venerable Mark Schonewille which may help -
Add a menu to the dock or system tray icon
This stack helps you create a script that adds a menu to the icon in the Dock of Mac OS X or the system tray of Windows.
*Edit 2 - This
thread also had some information in it, and further explanation of Mark's example can be found
here.
I will say, I also didn't find anything that would be considered "up to date", but that may be due to it
. a) not being a big concern (not a lot of requests) or
. b) because existing solutions are available, or
. c) 'other'
Dunno which, or why.
Re: Windows system tray icon
Posted: Wed Dec 13, 2017 10:57 am
by rblackmore245
Yes sorry I did mean minimize the application to the systemtray, I did find a solution deep in the forums ages ago but it didn't seem reliable.
As I do not want the application icon hogging the task bar but still need to notify the user that it is still running and give them the option to restore this application to the foreground.
Re: Windows system tray icon
Posted: Wed Dec 13, 2017 9:56 pm
by MaxV
The livecode update checker use the systemtray (systray).
What command or property did it use?
Re: Windows system tray icon
Posted: Wed Dec 13, 2017 10:01 pm
by bogs
MaxV wrote: ↑Wed Dec 13, 2017 9:56 pm
The livecode update checker use the systemtray (systray).
What command or property did it use?
LOL, that is right, the updater does run in the sys tray, I had forgotten since thats the first thing I turn off in settings

Re: Windows system tray icon
Posted: Thu Dec 14, 2017 1:05 pm
by LiveCode_Panos
Hi all,
See comments 3 and 4 in this bug report for a working solution:
http://quality.livecode.com/show_bug.cgi?id=20762
Best,
Panos
--
Re: Windows system tray icon
Posted: Thu Dec 14, 2017 3:52 pm
by bogs
Wow, now that is impressive, the OP found undocumented features, and Max's bug report got a response in a couple days explaining how to over come that. Btw, thank you Panos for the work arounds
*Edit - interesting information in the stack comments you might want to pay attention to if your using this technique and any database script operations in Win7.
*Edit - also interesting that this does not appear to work on Linux, where as the updater *does* appear able to put a system tray icon (notification area).
Re: Windows system tray icon
Posted: Fri Dec 15, 2017 8:02 am
by AndyP
Excellent sleuthing!
Definitely one for my snippets lib.
Re: Windows system tray icon
Posted: Fri Dec 15, 2017 5:58 pm
by rblackmore245
Yeah found it also via the facebook livecode page:
on mouseup
set the statusicon to 1004
set the statusicontooltip to "This is a test"
set the statusIconMenu to "Show" & cr & "Other"
end mouseup
on statusIconMenuPick pPick
if pPick is "Show" then
answer "Going to show"
set the statusIcon to 0
set the iconic of stack "TestWinTray" to false
end if
if pPick is "Other" then
answer "Doing other"
end if
if pPick is not "Show" and pPick is not "Other" then
answer "not Show, not Other"
end if
end statusIconMenuPick
Re: Windows system tray icon
Posted: Tue Dec 19, 2017 5:55 pm
by matthiasr
@Panos
this makes me remembering that i asked Livecode Mark when he or Kevin introduced the Mac OSX native button at LC Global about the possibility to add a status icon to the Mac OS X menu bar. He promised to check. And at a later LC global i asked again and he said that he will ask Ali to have a look at it.
Could you be so kind and ask/check if there was further progress on this?
We are using the status icon and the menu in windows for quite a long time now and it would be great to have something similar for Mac OS X.
Regards,
Matthias