LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you change the icon on a CVI generated panel when it is used in a VisualC++ dll?

I have created a CVI panel with buttons etc and converted it to code using th eCVI7.0 utility. I am using this panel inside a MSDevStudio generated Visual C++ dll. Everything works fine except the icon in the panel bar is a deault CVI icon. How do I change this?
0 Kudos
Message 1 of 2
(3,611 Views)
Currently the only way to set the icon on a CVI panel is to handle the WM_SETICON message using the Windows SDK. Kinda like the following

{
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);
}
}

Hope this helps


Bilal Durrani
NI
Bilal Durrani
NI
Message 2 of 2
(3,611 Views)