Solved

How to create short cut icons???

Posted on 2001-07-10
16
167 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
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.

 

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

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

867 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

19 Experts available now in Live!

Get 1:1 Help Now