First off, you can't use LoadImage()
to load a PNG image.png
file as an HBITMAP
. See questions like How would I load a PNG image using Win32/GDI (no GDI+ if possible)? and How would I draw a PNG image using LoadImage and StretchDIBits? for alternatives.
Second, once you do have your image loaded as an HBITMAP
(or HICON
), you can assign it to the button using the BM_SETIMAGE
message.