Page 1 of 2

New UserLib : NotifyIcon library

Posted: Fri Mar 11, 2005 8:07 pm
by Flype

Code: Select all

------------------------------------------------------------
- Object:   NotifyIcon UserLibrary / SHELL_NOTIFYICON
-           
- Descr:    Set of functions for the Systray Icon
-           From the 'shellapi.h' Microsoft include file
-           
- Version:  1.0 Beta
- Date:     Mars 2005
-           
- Compil:   Compiled with Purebasic 3.93
-           Maded with TailBite 1.2 Beta 2.3
-           
- Author:   Philippe 'Flype' Carpentier
- Email:    flype@altern.org
------------------------------------------------------------

------------------------------------------------------------
**** WARNING - PLEASE READ FOLLOWING NOTES ****
------------------------------------------------------------

The help file is UNDER CONSTRUCTION.

Please, refers to the purebasic example file provided
in the archive to understand how to use this UserLibrary.

This library extends the SysTray functions set of Purebasic.
But not only for Window95+. It allows to use new functionnalities
of Windows 2000, Windows XP, and the XP SP2 features.

------------------------------------------------------------
FUNCTIONS FOR THE NOTIFYICON API
------------------------------------------------------------

Result.l = ni_Add(uID.l, tip.s, hIcon.l)
Result.l = ni_Remove(uID.l)

Result.l = ni_Hide(uID.l)
Result.l = ni_Show(uID.l)
Result.l = ni_Focus(uID.l)
Result.l = ni_Icon(uID.l, hIcon.l)

------------------------------------------------------------
TOOLTIP AND BALLOON ( CARTOON STYLE ) FUNCTIONS
------------------------------------------------------------

Result.l = ni_Tip(uID.l, tip.s)
Result.l = ni_Info(uID.l, title.s, info.s, Flags.l)

------------------------------------------------------------
FUNCTIONS FOR LOADING ICONS OR USING EXISTING ONES
MAKING LIFE A LITTLE BIT EASIER...
------------------------------------------------------------

hIcon.l = ni_LoadIcon(IconFileName.s)
hIcon.l = ni_ExtractIcon()
hIcon.l = ni_DefaultIcon()

hIcon.l = ni_IconWinLogo()
hIcon.l = ni_IconQuestion()
hIcon.l = ni_IconHand()
hIcon.l = ni_IconExclamation()
hIcon.l = ni_IconAsterix()
hIcon.l = ni_IconApplication()
You can download it here : NotifyIcon_UserLib.zip

The source code is provided in the archive, making it easier to recompile with TailBite if needed.
Also, it could be a good tutorial on how to use the very new features of Windows 2000 to XP SP2.

Best Regards

Posted: Tue Mar 15, 2005 1:25 pm
by P-J
Nice one!

What does this library offer that the existing PB system tray stuff doesn't?

Posted: Tue Mar 15, 2005 2:35 pm
by dagcrack
Well is there any updated lib for the win32 api and such?

"
ProcedureReturn Shell_NotifyIcon_(#NIM_MODIFY,@ni)
"

Getting error, cant find the function ?

Posted: Sat Mar 19, 2005 12:10 am
by Flype
@P-J
mainly the " Result.l = ni_Info(uID.l, title.s, info.s, Flags.l) " function offer the ability to display this kind of balloon tooltip, specially on windows XP
... Image

also there are some new functions, not included natively in Purebasic
Result.l = ni_Hide(uID.l)
Result.l = ni_Show(uID.l)
Result.l = ni_Focus(uID.l)


@dagcrack
no - don't think so... i compiled it using PB3.93 and last version of TailBite, no more. maybe it's because you have win98 ? i tried to make it as compatible as possible, so...

Posted: Sat Mar 19, 2005 1:11 am
by El_Choni
@dagcrack: can you specify the error a little bit? Thx, regards,

Posted: Sat Mar 19, 2005 2:34 am
by dagcrack
it just cant find the function
maybe I got oldie libs

Posted: Sat Mar 19, 2005 3:22 am
by NoahPhense
Very kewl Flype... nice Lib..

- np

Posted: Fri May 13, 2005 6:33 pm
by Pantcho!!
:roll: how do you manage to control it with addsystray to a popupmenu?!

*edit* - the lib should have a help file, its a great lib!
but the main problem is in the txt help file you dont mention there is a MyWindowCallBack that need to be called.

great lib looking forward for the help file with more examples. :o

Posted: Fri May 13, 2005 7:19 pm
by Killswitch
On my computer (XP Pro) i've found a bug. If I use one of the ballon commands I have to remove the existing icon then add a new one before I can use another ballon.

Posted: Mon May 16, 2005 9:41 am
by GeoTrail
Very nice lib, I like it :)

Posted: Mon May 16, 2005 11:40 am
by Pantcho!!
Killswitch wrote:On my computer (XP Pro) i've found a bug. If I use one of the ballon commands I have to remove the existing icon then add a new one before I can use another ballon.
what do you mean?

if you mean that while the ballon is open and you want to send another ballon instead of that for me it works good. as long as its the same baloon ID number.

Posted: Mon May 16, 2005 8:55 pm
by Killswitch
Let me be clearer. With the example that comes with the library I add an icon to the systray then try a balloon, it works fine. I close the balloon with the X button in it. If I then try to open a new ballon of the same type, or a new one it won't work unless I remove that icon, then add another. I have to repeat this in order to get it to work.

Posted: Tue May 24, 2005 7:54 pm
by Flype
hummm, interessant bug...
this mean that i must come back in the source again.
i didn't change it since last upload. and sorry for being late.
:roll:

Posted: Wed Jun 08, 2005 10:52 am
by Blade
How can I handle the #PB_Event_SysTray events to use a pop-up menu with the systray icon, using this lib?
Can't it be compatible with Pure's AddSysTrayIcon ?

Posted: Fri Jun 10, 2005 5:17 am
by Intrigued
Blade wrote:How can I handle the #PB_Event_SysTray events to use a pop-up menu with the systray icon, using this lib?
Can't it be compatible with Pure's AddSysTrayIcon ?
I am also wondering how to create an 'options' menu for a SysTray icon. It needs to work on 98SE and newer M.S. OSes. Ideas?

Thanks,