I have a button.
HWND button = CreateWindow("button", "test_text", WS_VISIBLE | WS_CHILD, 0, 0, 500, 500, window, NULL, NULL, NULL);
"window" is my HWND variable of my window.
How can I add icon like this
HBITMAP hBitmap = (HBITMAP)LoadImage(NULL, TEXT("1.png"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
to my "button" variable?
I serched information about my problem in the Inthernet, but I can't find anything, that can work.
LoadImage
to load an icon or bitmap.You couldn't load.png
via LoadImage directly. And then useBM_SETIMAGE message
to associate a new image (icon or bitmap) with the button.