I try to get a list of active windows currently running in Windows 10. The same list as the alt+tab window shows. this is working find, but I also need the icons of these windows. Unfortunately this is not working. The following code returns a pointer which should be an hicon. But I have no idea how to interpret the hicon. How can I translate this to an image?
const user32 = new ffi.Library('user32', {
'SendMessageA': ['pointer', ['long', 'int32', 'long', 'int32']]
});
let WMessages = {WM_GETICON: 0x007F}
let hicon = user32.SendMessageA(hwnd, WMessages.WM_GETICON , 2, 0)
// how to translate hicon to an nodejs icon?
this logic is inside an EnumWindows loop but I cut it, since it is not of relevence for my issue. I am using ffi-napi and ref-napi to make native library call.
Any help is appreciated, thanks