Windows system tray icon
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 67
- Joined: Fri Jun 12, 2015 9:42 am
Windows system tray icon
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
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
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
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
Re: Windows system tray icon
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..rblackmore245 wrote: ↑Tue Dec 12, 2017 11:18 amI 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
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.
I think the system tray is supported in some fashion without LCB due to threads like this one.
Last edited by bogs on Tue Dec 12, 2017 3:21 pm, edited 1 time in total.
Re: Windows system tray icon
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
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 ->
*Edit - I also came across this from the venerable Mark Schonewille which may help -
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.
As I was editing my above post, I came across this thread in the link ->
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 -
*Edit 2 - This thread also had some information in it, and further explanation of Mark's example can be found here.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.
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.
-
- Posts: 67
- Joined: Fri Jun 12, 2015 9:42 am
Re: Windows system tray icon
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.
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
The livecode update checker use the systemtray (systray).
What command or property did it use?
What command or property did it use?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- Livecode Staff Member
- Posts: 818
- Joined: Fri Feb 06, 2015 4:03 pm
Re: Windows system tray icon
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
--
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
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).
*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
Excellent sleuthing!
Definitely one for my snippets lib.
Definitely one for my snippets lib.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search
-
- Posts: 67
- Joined: Fri Jun 12, 2015 9:42 am
Re: Windows system tray icon
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
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
-
- VIP Livecode Opensource Backer
- Posts: 190
- Joined: Sat Apr 08, 2006 7:55 am
- Location: Lübbecke, Germany
- Contact:
Re: Windows system tray icon
@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
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