I’m trying to make a custom exit button, and I have already created a custom graphic for the button in photoshop. I have the button as defined by this code:
button = CreateWindow(L"BUTTON", L"", WS_VISIBLE | WS_CHILDWINDOW, 400, 4, 480, 24, hWnd, button_id, hInstance, NULL);
I want to put either close.bmp or close.png or close.ico (whichever’s easiest) onto the button, however I cannot find a way to do this without MFC. Please help!!!
Thanks
Use the
BS_BITMAPorBS_ICONbutton styles. After creating the button, send it aBM_SETIMAGEmessage with the handle to your bitmap or icon. To get the handle to your bitmap or icon, useLoadImage.If your image has an alpha channel (transparency), make sure it’s saved as a 32-bit-per-pixel bitmap. You can get by with an icon, but the edges probably won’t be as smooth.