Page 1 of 1
Working in system tray
Posted: Fri Jan 23, 2009 1:22 pm
by alemrantareq
Hi everybody,
Is there any idea to show the app icon in system tray rather than in taskbar?

Posted: Sat Jan 24, 2009 11:05 am
by SparkOut
A simple search for "tray" will get you a selection of useful threads, if it's not immediately apparent that the item currently 8th below the sticky post at the top of the Windows forum is "Minimize to system tray" (by Paul D). That has some useful info and examples.
Posted: Sat Jan 24, 2009 4:41 pm
by Mark
alemrantareq,
There s a system tray sample in RevOnline, user name Mark.
Best,
Mark
Posted: Sun Jan 25, 2009 6:15 am
by alemrantareq
Thanks SparkOut & Mark for your replies.
I've seen the samples before creating this topic. I just want to create a simple clock which will show its icon in the system tray but not be hidden and not show the taskbar icon. So, I've made the following stack script -
Code: Select all
on preOpenstack
set the flag of me to not the flag of me
if the flag of me then startpolling
end preOpenstack
on startPolling
palette this stack
set the icon to 1009
set the raisepalettes to true
set the iconMenu to "Close"
put the time into fld "time"
if the flag of me then send "startPolling" to me in 100 millisecs
end startPolling
on iconMenuPick theItem
if theItem is "Close" then quit
end iconMenuPick
Problem is that if I make the stack palette, it doesnt update the time, and it shows taskbar icon if the stack is normal.
Mark's sample is fantastic but its made by "hide" command. I dont want to hide my stack rather it will float above the window.
Posted: Sun Jan 25, 2009 11:42 am
by SparkOut
Use a mainstack and substack approach.
If you make the display card in the substack and set it to be a palette, and the mainstack a normal stack which you hide with the example techniques shown that should work.
Put the polling handlers in the mainstack so that they remain active while minimised to tray, and just extend the line
to
Code: Select all
put the time into fld "time" of card "displayCard" of stack "timerSubstack"
Posted: Mon Jan 26, 2009 5:53 pm
by alemrantareq
Oh ! I've failed
I've created a substack and put a field to show the time. then I made the main stack hidden n keep it in startpolling to put the time into that field. If I make the substack palette, it works no more, but works in normal stack. And in normal stack, I cant hide it from the taskbar.
Posted: Mon Jan 26, 2009 10:02 pm
by Janschenkel
There are two things you can try: either set the systemWindow of your palette stack to true so that it floats above all other windows, or set the style of your stack to modeless to prevent the stack from appearing in the taskbar.
HTH,
Jan Schenkel.