How to change the icon in taskbar using windows api

后端 未结 1 422
时光取名叫无心
时光取名叫无心 2020-12-21 05:50

I am writing a small windows application.

I want to create a installer using nsis script.

I know how to change the default application icon, start menu icon

相关标签:
1条回答
  • 2020-12-21 06:29

    It's important to change all icons, including the application, both small and big:

    //Change both icons to the same icon handle.
    SendMessage(hwnd, WM_SETICON, ICON_SMALL, hIcon);
    SendMessage(hwnd, WM_SETICON, ICON_BIG, hIcon);
    
    //This will ensure that the application icon gets changed too.
    SendMessage(GetWindow(hwnd, GW_OWNER), WM_SETICON, ICON_SMALL, hIcon);
    SendMessage(GetWindow(hwnd, GW_OWNER), WM_SETICON, ICON_BIG, hIcon);
    
    0 讨论(0)
提交回复
热议问题