Skip to content
⌘ NSIS Forum Archive

Tray icon

113 posts

Joel#
Originally posted by brainsucker

2. System does nothing with the letter A at the proc name end
Just to be clear: I used the term "A" for the conversion from
Visual Basic 4/5/6 API declare function to system plugin syntax 🙂
RDaneel#
brainsucker,

You certainly are an energetic person! 🙂

Really, be careful with the A/W thing - in general, the A/W naming convention *is* the rule in Win32 system API calls that have any dealings with text, whether as parameters, or in this case, in a structure that is a parameter.

As it happens, for *some* of the API calls, an additional entry point (without A/W) is defined to be the same as the entry point for the "A" version of the call... but not all of them!

So, while Shell_NotifyIcon does have the "extra" entry point, others do not (e.g., ShellAbout and ShellExecute).

Hmmm... might you want to include the strategy on failed GetProcAdress calls that I mentioned earlier (you would only need to make this change in one place)? If you/we can convince yourself/ourselves that the "A" version is probably what the NSIS scripter actually meant to use, this *could* save some confusion - at the cost of further obscuring how things actually work, of course. 😁
brainsucker#
Afrow UK: I'm thinking about right click menu, but it'll have a little sense anyway (there are 2 ways I see, and both are ugly: 1. assign some variable some value on menu selection, and then check it thru the script 2. Pool some plugin function which will return menu status). Any ideas about additional functionality?

RDaneel: 🙂
"Really, be careful with the A/W thing"
🙂 I've just forgotten that damn letter!!!! 😉 🙂

System+A: ok... good idea.
Afrow UK#
I think it wouldn't be possible for nsis programs to recieve the values from the menu.
Because NSIS only runs the codes in different places (in oninit, after a page etc) not constantly...

We can forget the return values I suppose.
It's just up to the dll now to bring the program on-top when the user clicks on the sys tray icon.
You could allow additional defines when calling the plugin (no idea what plugin is called but,)

TrayIcon::Load "Icon" "Hover title"
TrayIcon::Menu "TI_MINIMIZE, TI_OPEN" "Menu header text"
TrayIcon::Close

Going over the top would be, I dunno...

TrayIcon::Menu "SubMenu('Readme'), Menu('Open Readme', exec $INSTDIR\readme.txt)"

This would create a submenu, which on moueover brings up a second menu which inturn has a button to open the installer readme.

lol

-Stu 🙂
kichik#
Afrow, where did you put the creation code? It must not be in .onInit because in there $HWNDPARENT is not valid.
Afrow UK#
Thanks, but after moving it to GUIInit or one of my custom pages, the installer would just crash onInit, and wouldn't even reach any dialogs.

-Stu
Afrow UK#
May I ask how the plugin is going?
I have till next weekend to prepare for the release of my 12 map D-Day campaign, along with the release of my NSIS installer.

It would be nice to get the tray icon working by then, but I can always release the installer (program) again later (It has built in updater).

-Stu
brainsucker#
Sorry... I've got some immediate work (programming USB device).... so ASAP. ;(

BTW, would you like to remove program from taskbar on minimize only, or at any time?
Afrow UK#
Well, it at the moment I've used System code to remove the taskbar item perminantly for the settings tab (which is executed with ExecWait)
But, indeed yes, it would be nice if the taskbar item dissapeared on minimize.

-Stu
brainsucker#
Hide on minimize is 10000000 times easier 🙂 I've f*cked all the Sunday of the last week with hiding at normal state (WS_EX_TOOLBOX sux - make new styles and so on, and other techiques work hard with nsis window).
I'll release tomorrow (i think) minimal version with hide on minimize and no right click menues (but with balloon tooltips for example 😉.
Afrow UK#
Now, thinking about it, will it be able to work like this:

Installer is ran, and sys tray icon is made (installer is also shown, and task bar item)
User clicks on sys tray icon to show installer ui and show the task bar item.
Sys tray icon stays until installer is closed.
On installer minimization, task bar item dissappears (along with installer ui) Sys tray icon stays.

Thanks for everything!

-Stu
tarwal2#
Did this plugin ever get made? Sounds pretty useful for my purposes. I basically have two installs (one that downloads the second) and it would be nice to have a tray icon that shows progress (and options) for while the second setup is downloading.
Afrow UK#
Brainsucker is still working on it (I assume)

I went and released my program (installer) b1 without the Task Bar functionality.
When the plugin is finished, I can simply upload the new version of my program (using the plugin), and when everyone runs my program it will download the update for them.

-Stu
brainsucker#
Afrow 🙂 Hope you'll forgive me that delay... I've got so many immediate work... If I'll finish it (work) tomorrow (today) (in basic), I'll try to bring plugin online this evening (there is nothing to do with it actually, in simpliest form (hide on minimize) at last). I'm really sorry...
Afrow UK#
No theres honestly no rush.
I was just hoping that it hadn't been forgotten!

Thanks for showing that it's still there!

-Stu 🙂
brainsucker#
So... finally... My conscience won the fight with me 🙂
Sorry again for such a long delay...
Hope it will satisfy all your needs.
n0On3#
why is the traybar called 'taskbar notification area'? Regular taskbar also notifies that some program is running.

Show me the light! 🙂
Afrow UK#
Great work, and thanks.
Right now however, when calling NotifyIcon::Icon r, my installer crashes.

-Stu
Afrow UK#
I am also on Windows XP-Pro.
See attached script.

I'm using the remove call in .onInstSuccess .onUserAbort and my custom Abort function.

-Stu
Afrow UK#
Testing script

\/
Afrow UK#
Well, after using it in .onGUIEnd, the icon isn't removed at all.

Updated testing attachment

-Stu