NotifyIcon Libary

dzt

Active Member
Licensed User
Allows to display an icon to Notification Area on PPC (NotifyIcon.dll) and to Systam Tray on PC (NotifyIconDesktop.dll)

Functions:
Add - Adds the application Icon to Notification Area for PPC and the icon ni.ico to System Tray for PC. For PPC the icon should be 16x16 pixels.

Remove - removes the Icon


Properties:
IconText - (PC only) The text to display when the mouse is over the icon

Events:
Click - Fires when the icon is clicked

The PPC source code (with some modifications) is from NotifyClient sample found on MSDN (Microsoft Developers Network)

Attached is a zip file with DLLs and sample ni.ico

PPC version c# source code can be downloaded from here http://www.terracom.gr/basic4ppc/NotifyIcon_source.zip
PC version c# source code can be downloaded from here http://www.terracom.gr/basic4ppc/NotifyIconDesktop_source.zip

For how to use it, see dzSpy application I've posted here http://www.b4x.com/forum/showthread.php?t=452
 

Attachments

  • NotifyIcon.zip
    5.1 KB · Views: 553

Cableguy

Expert
Licensed User
Longtime User
I not to sure what this does!

Can you post a simple example?

P.S.: Your work is great....But form me, that i'm not familiar to some of the expressions and terms you use, or some device OS events, it gets difficult to understand what some of you dll actually do!!
 

dzt

Active Member
Licensed User
And a short sample.

Compile it (needs notifyicon libraries and formlib) and put test3.exe, NotifyIcon.dll and FormLib.dll in your device
Run test3.exe, press "Show Icon", then the cross upper right.

You will see the icon in Notification Area (as in pic1)

Click the icon...
 

Attachments

  • test3.zip
    9.2 KB · Views: 265
Last edited:

JJM

Active Member
Licensed User
Longtime User
Hi Dimitris,

Thanks for your new dll which is usefull for some programs.
I don't understand the use of ni.IconText ?

Please :sign0085:

Best regards

JJ M
 

dzt

Active Member
Licensed User
Hi JJM,

IconText is useful only for desktop computer not for PPC.
Put your mouse pointer over any icon in System Tray and you will see some text to appear.

For your program you could set this text using the IconText property.

Run on your PC test3.sbp I've posted.

Regards
 

Cableguy

Expert
Licensed User
Longtime User
At least for me when icontext is set it get covered by the TaskBar so the text is not visible...
 

dzt

Active Member
Licensed User
Hi GableGuy,

I don't know why this happens to your computer. I've tested it in several PCs with various operating systems (Windows 2000, XP, Vista) and works fine in every case.

But I've made the library for PPC. The desktop version made only to help to design the app in basic4ppc. And in that case (PPC) IconText is a dummy property.

Regards
 

JJM

Active Member
Licensed User
Longtime User
Hi,

For me on my PC and on my PPC (HP ipac 2490) all is fine.

Best regards

JJ M
 

agraham

Expert
Licensed User
Longtime User
At least for me when icontext is set it get covered by the TaskBar so the text is not visible...
Are you running XP and is popup text from other icons on the task bar also covered by the task bar? If so then it is a known bug and either this short program or the batch file in the text file should fix it.

This used to happen occasionally on my XP system and when it did I just ran FixToolTips.exe for an instant fix.
 

Attachments

  • FixToolTips.zip
    15.4 KB · Views: 102

Cableguy

Expert
Licensed User
Longtime User
Thanks Agraham, That did the trick....Never happend before with any other app....that was the first time, and my system is about 6 months old...with a few hundred apps running...
 

agraham

Expert
Licensed User
Longtime User
Never happend before with any other app
It's not app dependent and no-one seems to know quite why it happens and Microsoft never fixed it. Some systems suffer, on others it never happens. It doesn't happen on my laptop but it occurred every couple of months on my main system (now on Vista).

Keep that little app - you may need it again in a month or so!
 

dzt

Active Member
Licensed User
Hi all,

The old NotifyIcon.DLL for PPC does not work for apps compiled by B4PPC version 5.80 and above. This is because the icon name inside the .EXE has changed from "#32512" (default resource name) to "B4PICON".

The new attached NotifyIcon.DLL targets by default to version 5.80 and above (at least until the icon name remains the same).

But setting it's newly added property Version580andAbove = False will work fine for previous versions also.

No problem and therefore no new version for NotifyIconDesktop.DLL

This issue pointed by alfcen here http://www.b4x.com/forum/showthread.php?p=6437#post6437

Thank you Robert!
 

Attachments

  • NotifyIcon.zip
    2.8 KB · Views: 73

dzt

Active Member
Licensed User
Hi,

Attached in the zip is the new NotifyIcon compatible with Basic4PPC v6.0.

A new property added: Version6andAbove.
Set it to True (default) to work with v6.0
 

Attachments

  • NotifyIcon_03.zip
    5.1 KB · Views: 128

burd27

Member
Licensed User
Has anyone else had an issue where no Icon appears on the Today Screen Toolbar?

I have written my own code using this Library, but no Icon appeared. So I downloaded the "Test3" sample, compiled it (non optimized), etc....still no Icon.

I have the Form Library, NotifyIcon Library and the ni.ico all in the same directory as the ".exe" file. I have the latest version of the NotifyIcon Library. I am running B4P 6.05 / WM5 on a Dell Axim X51v.

On the Desktop, the Icon appears in the SysTray and if clicked triggers the ni_click procedure fine. But nothing works on the Device.

Obviously, I'm missing something. Any Ideas?

Burd
 
Last edited:

alfcen

Well-Known Member
Licensed User
Longtime User
Hi Burd,
It works well on an iPAQ hx210 WM6.0 with this code.
To rule out all odds, please make sure that you have
assigned a 256 color icon in File/Chose Icon:

For the device you won't even need the Formlib.dll

On a bad note, this does not show the icon in the tray
of an iPAQ h2100 running PPC 2003. If you tap on the
place in the tray where it is supposed to be then the
program comes up again, though.

B4X:
Sub App_Start
  ni.New1
  ni.Version580andAbove = true 'del for optimized compiler
  ni.Add
End Sub

Sub ni_Click
  frmMain.Show
End Sub
 

burd27

Member
Licensed User
Thanks Alfcen for your reply.

In essence your code is the same as mine. What I have discovered is that if I "Optimize Compile" it, it works fine and the Icon appears. If I compile it "standard" it doesn't appear, nor does the program fire up when you "click" the spot where the icon should have been.

I am running B4P 6.05 on the device, so I have tried the "ni.Version6andAbove = True", but it makes no difference to the above findings. (Which I would suspect as "True" is the default value.)

So now if I optimize compile it, then all is fine. But the little problem that I have at the moment, is that the application that I wanted to use the "ni" on, also uses the Calendar control, which for the time being is not compatible at all with Optimized Compile. (Although, I do believe that Erel may be working on that one for a future release. I wait in hope!) : )

Thanks again.
 

miataman

Member
Licensed User
And a short sample.

Compile it (needs notifyicon libraries and formlib) and put test3.exe, NotifyIcon.dll and FormLib.dll in your device
Run test3.exe, press "Show Icon", then the cross upper right.

You will see the icon in Notification Area (as in pic1)

Click the icon...


I'm running sample Test3.Exe and error :

"error CS1501: aucune surcharge pour la méthode 'GetControlStringOrRef' ne prends pas d'argument '0'
line number 6
line ni.New1

???? my version 4PPC is 6.30
thanks
stef
 
Top