hbm1 = LoadBitmap(app, MAKEINTRESOURCE(IDB_BITMAP4));
hbm2 = LoadBitmap(app, MAKEINTRESOURCE(IDB_BITMAP2));
CreateWindow(
"BUTTON", // predefined class
"", // button text
WS_VISIBLE | WS_CHILD |BS_OWNERDRAW , // styles
// Size and position values are given explicitly, because
// the CW_USEDEFAULT constant gives zero values for buttons.
10, // starting x position
20, // starting y position
100, // button width
60, // button height
hWnd, // parent window
(HMENU)5, // No menu
(HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),
NULL); // pointer not needed
case WM_DRAWITEM:
{
if (wParam == 5)
{
LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
HDC hdcMem = CreateCompatibleDC(lpdis->hDC);
HDC hdc = CreateCompatibleDC(lpdis->hDC);
if (yes)
SelectObject(hdcMe