LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Different Icons for an CVI Application with 2 Taskbar buttons

I have an application, with 2 Panels.
Each Panel has its own Taskbar button (activated option "Has Taskbar Button").

How do i assign each Panel (and the taskbar button) a different icon ?

I can assign only one icon during the build process for all panels 😞

Thanx, Bernd.
0 Kudos
Message 1 of 3
(2,892 Views)
Hello

The icon select in the build process is for the application itself. Currently, there is no way to assign an icon to each indivudual panels.

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(2,892 Views)
.
I found the answer by myself:
It works with the Windows API.

{
HWND hWnd;
HICON hIcon;

// -- get window handle of the panel
GetPanelAttribute (iPanel, ATTR_SYSTEM_WINDOW_HANDLE, (int *)&hWnd);

// -- load the icon file
hIcon = LoadImage (NULL, "test.ico", IMAGE_ICON, 16, 16, LR_LOADFROMFILE);

// -- if icon was loaded successful
if(hIcon)
{
// -- set the (small) icon !
SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
}
}
Message 3 of 3
(2,892 Views)