LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Application Icon at run time

Is it possible to change the application icon at run time ? Similar to "SetSystemAttribute (ATTR_TASKBAR_BUTTON_TEXT,  ...)" which changes to displayed text, I'm looking for a way to change the icon displayed in the taskbar instead of the application title.
 
Best regards
 
0 Kudos
Message 1 of 5
(3,866 Views)
hello tomsaw,

maybe you could implement something like that via the windows SDK.
i found an example pointing in this direction in the MSDN
here

regards,

robert h
NI germany
0 Kudos
Message 2 of 5
(3,839 Views)
Hi Tomsaw,
 
I have attached an example program that uses the Windows SDK functions LoadImage and SendMessage to dynamically change the icon at runtime. Here is the Windows SDK documentation for SendMessage and LoadImage. Simply open up the project, run it and click the Change button to update the icon.
 
Best Regards,

Message Edited by Jonathan N on 11-07-2006 12:21 PM

Jonathan N.
National Instruments
0 Kudos
Message 3 of 5
(3,822 Views)

Thank you for your effort !

I tested your "Change Icon" Sample, but that's not what I want. The Icon changes in top of the panel, but the icon displayed on the taskbar ("application icon") remains the same. Also the Icon by doing task switching on windows with ALT+TAB remains the same. I was looking for a way to change THIS icon ...

Best regards,

    Tomsaw

 

0 Kudos
Message 4 of 5
(3,807 Views)

Howdy Tomsaw,

Sorry that I misunderstood what you were asking before. Attached is a new updated program that updates all icons. I introduced a new Windows SDK function called GetWindow. Also note on the SendMessage function, you need to use both ICON_SMALL and ICON_BIG to update the various icons in the taskbar and alt-tab view. This is described on Microsoft at this link.

Refer to this link to clarify how Windows stored icons for an application.

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
Message 5 of 5
(3,784 Views)