c++ - Unable to have different icons for taskbar and window bar? -


i have 2 icons (.ico files). big 32x32 1 , small 16x16.

enter image description here

i'm trying set hicon of wndclassex big one, , hiconsm smaller one. yet cannot life of me figure out how that! first tried loadicon:

wndclass.hicon = loadicon(instance, makeintresource(idi_skeleton)); wndclass.hiconsm = loadicon(instance, makeintresource(idi_skeleton_sm)); 

it loads same icon both top window bar , taskbar. same thing loadimage.

enter image description here

here's codes:

resource.h

#define idi_skeleton 1000 #define idi_skeleton_sm 1001 

skeleton.rc

#include "resource.h"  idi_skeleton       icon "skeleton.ico" idi_skeleton_sm    icon "skeleton_sm.ico" 

winmain.cpp

#include <windows.h> #include "resource.h"  lresult callback handleevent(hwnd   window,             uint   message,             wparam wparam,             lparam lparam) {     switch(message)     {         case wm_paint:         {             paintstruct ps;             hdc dc;             rect rect;              dc = beginpaint(window, &ps);             getclientrect(window, &rect);             drawtext(dc, text("this test window"), -1, &rect,                          dt_singleline | dt_center | dt_vcenter);             endpaint(window, &ps);         }         break;          case wm_close:         {             postquitmessage(0);             return 0;         }         break;     }     return defwindowproc(window, message, wparam, lparam); }  int callback winmain(hinstance instance,         hinstance previous,         lpstr     cmd,         int       cmdshow) {     wndclassex wndclass;     tchar classname[] = text("24hoursclass");      wndclass.cbsize = sizeof(wndclass);     wndclass.style = cs_vredraw | cs_hredraw;     wndclass.lpfnwndproc = handleevent;     wndclass.cbclsextra = 0;     wndclass.cbwndextra = 0;     wndclass.hinstance = instance;     wndclass.hicon = (hicon)loadimage(instance, makeintresource(idi_skeleton), image_icon,              getsystemmetrics(sm_cxicon), getsystemmetrics(sm_cyicon), 0);     wndclass.hiconsm = (hicon)loadimage(instance, makeintresource(idi_skeleton_sm), image_icon,              getsystemmetrics(sm_cxsmicon), getsystemmetrics(sm_cysmicon), 0);     wndclass.hcursor = loadcursor(null, idc_arrow);     wndclass.hbrbackground = (hbrush)(color_window + 1);     wndclass.lpszmenuname = 0;     wndclass.lpszclassname = classname;      registerclassex(&wndclass);      hwnd window = createwindowa(classname, "24 hours",             ws_overlappedwindow | ws_visible,             cw_usedefault, cw_usedefault, cw_usedefault, cw_usedefault,             0, 0, instance, 0);      msg msg;      while(getmessage(&msg, window, 0, 0))     {         translatemessage(&msg);         dispatchmessage(&msg);     }      return 0; } 

what missing?

any appreciated!


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -