I am creating a firefox addon with js-ctypes and have used the user32.dll functions to set the icons of all profile windows.
I plan to do this for Mac OS and Linux, but first try to knock out Windows.
So, I set the icons as follows: GitHub - Gist :: Noitidart / _ff-addon-snippet-ChangeWindowIcon.js - Rev2
This code is simplified. This code that I use for all windows:
Cu.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); var SendMessage = user32.declare('SendMessageW', ctypes.winapi_abi, ctypes.uintptr_t, ctypes.int32_t, ctypes.unsigned_int, ctypes.int32_t, ctypes.voidptr_t ); var LoadImage = user32.declare('LoadImageA', ctypes.winapi_abi, ctypes.voidptr_t, ctypes.int, ctypes.char.ptr, ctypes.unsigned_int, ctypes.int, ctypes.int, ctypes.unsigned_int ); var IMAGE_BITMAP = 0; var IMAGE_ICON = 1; var LR_LOADFROMFILE = 16;
Therefore, the following problems arise:
- Problems with WinXP
- When you press
Alt + Tab icon is normal. - If the windows are grouped into one group (due to the overflow of the taskbar) and ALL the icons are changed, the concentrated group icon is still not changed. As seen in the figure:

- Problems with Win7
- If the application is PINNED and even if all the window icons are changed to be the same, it still did not change the icon icon
- If the application is not PINNED, then if you change the icon for all windows, it will change the icon on the taskbar. If you right-click on the icon on the taskbar, it will go back to what was common and launched the snapshot above, don't set it back to return it to the icon you set, you need to attach and cancel
Thanks Noit
c ++ firefox-addon icons user32 jsctypes
Noitidart
source share