Solved

How to create short cut icons???

Posted on 2001-07-10
16
164 Views
Last Modified: 2012-08-13
Hi,
  Here is my problem.i need solution place my program in the place nearer to the time in the task bar.when ever I want to open my program just clicking that icon it will open.Any solution in VB.
Thanks in advance...
0
Comment
Question by:N_K_venkat
  • 7
  • 6
  • 2
  • +1
16 Comments
 
LVL 20

Expert Comment

by:hes
ID: 6269684
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6271610
Hi venkat,

Another sample here:

Manipulating System Tray Icons using Shell_NotifyIcon:
http://www.mvps.org/vbnet/code/subclass/shellnotifybasic.htm

'Hope will help.
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6271931
Hi!

Here's another one:

Download...
http://www.vb-helper.com/Howto/tray3.zip

Description: Make a "formless" program with a system tray icon (3K)

Download...
http://www.vb-helper.com/Howto/sysanimt.zip

Description: Animate an icon and put a form in the system tray (6K)

That's it!

glass cookie : )
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6271937
No matter whose comment you're accepting, please try to give an 'A' as much as possible : )

That's it!

glass cookie : )
0
 

Author Comment

by:N_K_venkat
ID: 6354951
Hai hes ,
 very nice this code is working but i am having some other problem also.i have written some time calculation in the timer event.i need to show the value of one Integer when i am focusing the icon on the tray.now it gives some sample coding.say that integer may be incremented every sec.
i placed that code for showing the tool tip in the timer event but its not giving the present value of the integer as tool tip.
Thanks for the previous code and
Bye from
N.K.venkat
0
 

Author Comment

by:N_K_venkat
ID: 6355022
how to load a animated gif image into the system tray instead of an icon.
0
 

Author Comment

by:N_K_venkat
ID: 6355028
how to load a animated gif image into the system tray instead of an icon.
0
 

Author Comment

by:N_K_venkat
ID: 6355034
how to load a animated gif image into the system tray instead of an icon.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:N_K_venkat
ID: 6355045
how to load a animated gif image into the system tray instead of an icon.
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6355068
Well, I doubt you'll be able to do it.

To prove whether you can really do it or not, try this piece of code and replace those icon files in the controls to that of a gif image (non-animated).  If the non-animated file doesn't even work, I suppose you can forget about the animated one too.

Code coming up...
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6355080
Download...
http://www.vb-helper.com/HowTo/sysanimt.zip

Description: Animate an icon and put a form in the system tray (6K)

Well, if you really want to put in those pictures from an animated gif (and provided that you've got the program to split the animated gif into it's respective pictures) into the system tray, you can cut and paste into this program to create icons.

Download...
http://www.impactsoftware.net/download/mike5.exe

OR this alternative site to download (from the home page)...
http://download.cnet.com/downloads/0-1476516-108-17056.html?bt.15897.10015..dl-17056

Program name: Microangelo v5.02

That's it!

glass cookie : )
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6355089
Hi N_K_venkat,

Agree with glass_cookie, you can use a Timer to change the icon on system tray but not an animated gif file. You can only mimic the looks of gif but not exact a gif file..

And Microangelo is a Good Software, have a try!

0
 

Author Comment

by:N_K_venkat
ID: 6355205
Dear Friends,Reg system Tray
i have written some time calculation  in the timer event.i need to show the value of one Integer when i am focusing the icon on the tray.say that integer may be incremented every sec.i placed that code for showing the tool tip in the timer event but its not giving the present value
of the integer as tool tip.
Bye from
N.K.venkat
0
 

Author Comment

by:N_K_venkat
ID: 6355224
Dear Friends,Reg system Tray
i have written some time calculation  in the timer event.i need to show the value of one Integer when i am focusing the icon on the tray.say that integer may be incremented every sec.i placed that code for showing the tool tip in the timer event but its not giving the present value
of the integer as tool tip.
Bye from
N.K.venkat
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6356093
Hi!

From the code I posted, I believe this should be whatever's given to add an icon to the tray:

'Click this button to add an icon to the taskbar status area.
         'Set the individual values of the NOTIFYICONDATA data type.
         nid.cbSize = Len(nid)
         nid.hwnd = Form1.hwnd
         nid.uID = vbNull
         nid.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
         nid.uCallbackMessage = WM_MOUSEMOVE
         nid.hIcon = Form1.Icon
         nid.szTip = "Click to show Form" & vbNullChar
 
         'Call the Shell_NotifyIcon function to add the icon to the taskbar
         'status area.
         Shell_NotifyIcon NIM_ADD, nid
         Form1.Hide


Well, in order to refresh the tooltip of the icon, you'll have to delete the icon first, reload the icon with the desired tooltip, then it can work.

But if you do, make sure that your timer has a long interval or else your system tray would flicker like nobody's business.

You'll have to add this code to your timer:

Dim i as integer

Private Sub Timer1_Timer()

'Delete the icon
Shell_NotifyIcon NIM_DELETE, nid

'Load the icon again
         nid.cbSize = Len(nid)
         nid.hwnd = Form1.hwnd
         nid.uID = vbNull
         nid.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
         nid.uCallbackMessage = WM_MOUSEMOVE
         nid.hIcon = Form1.Icon
         nid.szTip = "Click to show Form" & vbNullChar
 
         'Call the Shell_NotifyIcon function to add the icon to the taskbar
         'status area.
         Shell_NotifyIcon NIM_ADD, nid

End Sub

Well, I may be wrong about thie issue and hopefully you may get a better answer/comment than this.

That's it!

glass cookie : )
0
 
LVL 8

Accepted Solution

by:
glass_cookie earned 50 total points
ID: 6507623
Hi!

Found the code to midofy the icon:

         nid.cbSize = Len(nid)
         nid.hwnd = Form1.hwnd
         nid.uID = vbNull
         nid.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
         nid.hIcon = Form1.Icon
 
         'Call the Shell_NotifyIcon function to add the icon to the taskbar
         'status area.
           Shell_NotifyIcon NIM_MODIFY, nid

This, you could set the icon's tooltip, with the code:

           Shell_NotifyIcon NIM_MODIFY, nid

That's it!

glass cookie : )
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

757 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

17 Experts available now in Live!

Get 1:1 Help Now