i'm getting several problems on changing the window icon(menu icon).
i did several search and i did these function:
Code:
HICON hWindowIcon =NULL;
HICON hWindowIconBig =NULL ;
void SetIcon(HICON icon)
{
auto tmp_wi = hWindowIcon;
auto tmp_wib = hWindowIconBig;
if(hWindowIcon!=NULL)
DestroyIcon(hWindowIcon);
if(hWindowIconBig!=NULL)
DestroyIcon(hWindowIconBig);
hWindowIcon =CopyIcon((HICON)icon);
hWindowIconBig =CopyIcon((HICON)icon);
if(hWindowIcon!=NULL)
{
SendMessage( hwnForm, WM_SETICON, ICON_SMALL, (LPARAM)(HICON)hWindowIcon);//if i don't use these line
}
if(hWindowIconBig!=NULL)
{
SendMessage( hwnForm, WM_SETICON, ICON_BIG, (LPARAM)(HICON)hWindowIconBig );
}
DestroyIcon(tmp_wi);
DestroyIcon(tmp_wib);
}
how i use it:
Code:
frMain.SetIcon((HICON)MAKEINTRESOURCE(ICODiamond) );
but the icon still be the standard... isn't showed. what i'm doing wrong?