Solved

Text in System Tray

Posted on 2001-06-17
18
232 Views
Last Modified: 2010-05-02
I'm working on making a clock (like the system clock, except made by me), and I really need to know how I can add text to the system tray.  I found out how to add icons, but not text!

Please help!  Any comments or anything would be appreciated.

Preferably, I'd like it so that I can treat it almost like a label, or text box, something that I can easily edit the colors, background colors, etc.  Like:

statusbartext.backcolor = (whatever)

and

statusbartext.text (or caption) = "whatever"

Thank you so much!

75 pts is all I got :(

-Sam
0
Comment
Question by:samsonite_VB
  • 4
  • 4
  • 3
  • +4
18 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 38 total points
ID: 6200653
>I found out how to add icons, but not text!
You should add icon to systray.  Here is how to modify icon:

' Form1, add textbox, picturebox and Imagelist (dimensions 16x16)
Option Explicit

Private Sub Form_Load()
   Picture1.AutoRedraw = True
   Picture1.BorderStyle = 0
   Picture1.Width = 16 * 15
   Picture1.Height = 16 * 15
   Picture1.Font = "Small Fonts"
   Picture1.FontSize = 6
   Picture1.BackColor = vbWhite
End Sub

Private Sub Text1_Change()
   On Error Resume Next

   Picture1.Cls
   Picture1.Print Text1.Text
   ImageList1.ListImages.Remove "status"
   ImageList1.ListImages.Add , "status", Picture1.Image

   Set Me.Icon = ImageList1.ListImages("status").ExtractIcon

End Sub

Please, do not accept this comment 'as answer' if it isn't for A grade.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6200967
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6201291
For a different approach: http://www.geocities.com/timcottee/downloads/traywindow.zip

This sample project allows you to place an entire form in the system tray and have buttons/labels etc active within it.
0
 
LVL 4

Expert Comment

by:nutwiss
ID: 6201526
tim - your link's dead....

that's geoshitties for you :)
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6201555
nutwiss, this happens many times. If you go to http://www.geocities.com/TimCottee and click the downloads link you should get there. Don't ask me why the link is dead, I copied it straight off the page myself!
0
 
LVL 15

Expert Comment

by:ameba
ID: 6201599
It's problem with geocities server. To download file, right-click and select 'Save Target As'

I found their mirror server with prefix 'us.share' to always work with zip files:
http://us.share.geocities.com/timcottee/downloads/traywindow.zip
0
 
LVL 15

Expert Comment

by:ameba
ID: 6201613
>mirror server with prefix 'us.share' to always work

This is the first time that doesn't work for me.  :-)
So, the only solution is: right-click and select 'Save Target As'
0
 
LVL 4

Expert Comment

by:nutwiss
ID: 6201632
btw tim, your code works, but, it has to be said, shows little regard for windows standards - it's kind of rude to simply replace the system tray with your own window, don't you think? ;>>
0
 

Author Comment

by:samsonite_VB
ID: 6201889
Tim, your program is nice... but is there any way to get it NOT to take over the whole system tray?

It'd be awesome if It would just stick itself to the right of the last icon.

-Sam
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 43

Expert Comment

by:TimCottee
ID: 6201960
I am going to have a look at how this might be possible, either to do as you suggest or to place it in the taskbar as a seperate window.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6207219
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7136219
Hi samsonite_VB,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Split points between: ameba and Richie_Simonetti

samsonite_VB, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7138131
I didn't try his links but, what about Tim?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7138956
hi Richie_Simonetti,
I have to base my original recommendation on available info.  And I have expert input re TimCottee's solution already (see the nutwiss post of 06/18/2001 02:54AM).

Tim, want to add anything?
-- Dan
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7138980
Ok. My apologize.
Cheers
(keep the hard work, Dan. Thank you)
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7140124
nutwiss is right in what he says and as I don't really need the 100 points I am quite happy to leave it as suggested. Dan has recommended at least 10 other threads my way this morning so I am quite happy with that.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7140323
My new EE handle: Santa Claus :)
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7181558
Per recommendation, force-accepted.

Netminder
CS Moderator

Richie_Simonetti: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20328617
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now