Refresh Icon in Task Tray?? VB6 
Author Message
 Refresh Icon in Task Tray?? VB6

 I am having a helluva time trying to get my icon in the task tray to
refresh..
Basically what I have is this:

If mnuPRO.Checked = False Then
Me.Icon = Stp.Picture
ElseIf mnuPRO.Checked = True Then
Me.Icon = IC.Picture
Else
Me.Icon = Main.Picture

But when my program is sitting in the task tray, and I select the
mnuPRO via popup meny, the action works, but the icon doesn't change??
       Any ideas?
               Thanks              
                   Dave



Mon, 03 Dec 2001 03:00:00 GMT  
 Refresh Icon in Task Tray?? VB6
To refresh the icon in the tray, you have to make another call to the
Shell_NotifyIcon API function with the dwMessage Parameter set to NIM_MODIFY
and the NOTIFYICONDATA structure parameter set to reflect any icon changes.

Steve


Quote:
> I am having a helluva time trying to get my icon in the task tray to
> refresh..
> Basically what I have is this:

> If mnuPRO.Checked = False Then
> Me.Icon = Stp.Picture
> ElseIf mnuPRO.Checked = True Then
> Me.Icon = IC.Picture
> Else
> Me.Icon = Main.Picture

> But when my program is sitting in the task tray, and I select the
> mnuPRO via popup meny, the action works, but the icon doesn't change??
>        Any ideas?
>                Thanks
>                    Dave



Mon, 03 Dec 2001 03:00:00 GMT  
 Refresh Icon in Task Tray?? VB6
so to reflect my change in the below example, I would have to call it
by:
 If mnuPRO.Checked = False Then
call Shell_NotifyIcon(NIM_DELETE, NID)
 Me.Icon = Stp.Picture
 ElseIf mnuPRO.Checked = True Then
 Me.Icon = IC.Picture
call Shell_NotifyIcon(NIM_MODIFY, NID)
 Else
 Me.Icon = Main.Picture

is that right???

        thanks for the fast reply
                          dave



Quote:
>To refresh the icon in the tray, you have to make another call to the
>Shell_NotifyIcon API function with the dwMessage Parameter set to NIM_MODIFY
>and the NOTIFYICONDATA structure parameter set to reflect any icon changes.

>Steve



>> I am having a helluva time trying to get my icon in the task tray to
>> refresh..
>> Basically what I have is this:

>> If mnuPRO.Checked = False Then
>> Me.Icon = Stp.Picture
>> ElseIf mnuPRO.Checked = True Then
>> Me.Icon = IC.Picture
>> Else
>> Me.Icon = Main.Picture

>> But when my program is sitting in the task tray, and I select the
>> mnuPRO via popup meny, the action works, but the icon doesn't change??
>>        Any ideas?
>>                Thanks
>>                    Dave



Mon, 03 Dec 2001 03:00:00 GMT  
 Refresh Icon in Task Tray?? VB6
Thanks for your reply..... just after I got your reply, and after I
replied again.. I finally got it.. You helped me a GREAT deal! This is
what I did for others that have the same question:

        'changes the icon to display
        NID.hIcon = IC.Picture
        'removes current icon from tray
        Call Shell_NotifyIcon(NIM_DELETE, NID)
         'calls the API to add in new icon
        Call Shell_NotifyIcon(NIM_ADD, NID)

Thanks again;
            Dave



Mon, 03 Dec 2001 03:00:00 GMT  
 Refresh Icon in Task Tray?? VB6
Thanks for your reply..... just after I got your reply, and after I
replied again.. I finally got it.. You helped me a GREAT deal! This is
what I did for others that have the same question:

        'changes the icon to display
        NID.hIcon = IC.Picture
        'removes current icon from tray
        Call Shell_NotifyIcon(NIM_DELETE, NID)
         'calls the API to add in new icon
        Call Shell_NotifyIcon(NIM_ADD, NID)

Thanks again;
            Dave



Mon, 03 Dec 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Icon on tray area of task bar

2. Icon in Task Bar Tray

3. Program Icon in Task Tray

4. Task tray icon

5. Task Tray Icon

6. Refresh System Tray Icons

7. Refreshing System Tray Icon after Explorer Crashes.

8. VB6 system tray icon

9. CoolHide - Help you hide/minimize window to Tray and hide icons from the system tray

10. CoolHide - Help you hide/minimize window to Tray and hide icons from the system tray

11. Get an app up from the TRAY /update the tray icon

12. tray icon/menu icon

 

 
Powered by phpBB® Forum Software