• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

How to create short cut icons???

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
N_K_venkat
Asked:
N_K_venkat
  • 7
  • 6
  • 2
  • +1
1 Solution
 
hesCommented:
0
 
Ryan ChongCommented:
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
 
glass_cookieCommented:
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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

That's it!

glass cookie : )
0
 
N_K_venkatAuthor Commented:
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
 
N_K_venkatAuthor Commented:
how to load a animated gif image into the system tray instead of an icon.
0
 
N_K_venkatAuthor Commented:
how to load a animated gif image into the system tray instead of an icon.
0
 
N_K_venkatAuthor Commented:
how to load a animated gif image into the system tray instead of an icon.
0
 
N_K_venkatAuthor Commented:
how to load a animated gif image into the system tray instead of an icon.
0
 
glass_cookieCommented:
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
 
glass_cookieCommented:
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
 
Ryan ChongCommented:
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
 
N_K_venkatAuthor Commented:
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
 
N_K_venkatAuthor Commented:
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
 
glass_cookieCommented:
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
 
glass_cookieCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now