Link to home
Start Free TrialLog in
Avatar of N_K_venkat
N_K_venkat

asked on

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...
Avatar of hes
hes
Flag of United States of America image

Hi venkat,

Another sample here:

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

'Hope will help.
Avatar of glass_cookie
glass_cookie

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 : )
No matter whose comment you're accepting, please try to give an 'A' as much as possible : )

That's it!

glass cookie : )
Avatar of N_K_venkat

ASKER

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
how to load a animated gif image into the system tray instead of an icon.
how to load a animated gif image into the system tray instead of an icon.
how to load a animated gif image into the system tray instead of an icon.
how to load a animated gif image into the system tray instead of an icon.
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...
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 : )
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!

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
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
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 : )
ASKER CERTIFIED SOLUTION
Avatar of glass_cookie
glass_cookie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial