How to load embedded Icon via LoadIcon / LoadImage?
powellnorma opened this issue · comments
powellnorma commented
I have tried:
hModule, err := GetModuleHandle(nil)
hIcon, hModule = _LoadImage(mh, syscall.UTF16PtrFromString("APP"), 0, 0, 0)
hIcon, hModule = _LoadImage(mh, MakeIntResource(42), 0, 0, 0)
But both fail with The specified resource type cannot be found in the image file.
The winres.json file contains:
"RT_GROUP_ICON": {
"APP": {
"0000": "icon_256.png",
]
},
"#42": {
"0000": "icon_256.png"
}
},
powellnorma commented
Okay nvm - I forgot to add the the type parameter to the _LoadImage wrapper - Once thats added this works: _LoadImage(mh, UTF16PtrFromString("APP"), IMAGE_ICON, 0, 0, 0)