I have an other question about owner draw buttons.
In my main window everything works fine, but when I use ownerdraw buttons in a dialogbox, I have a huge bug.
at first everything is fine, but when I move the dialobox with its body of the screen, or I put an other window on top, the buttons are gone, shouldn't windows end a WM_DRAWITEM whenever the buttons need to be repainted?
or am I forgetting a function that call the WM_DRAWITEM?
here's the code for WM_DRAWITEM
Code:
case WM_DRAWITEM :
lpdis = (LPDRAWITEMSTRUCT) lParam;
hdcMem = CreateCompatibleDC(lpdis->hDC);
switch(lpdis->CtlID)
{
case IDC_PREV:
SelectObject(hdcMem, hbmprev);
StretchBlt(lpdis->hDC, lpdis->rcItem.left,lpdis->rcItem.top,
lpdis->rcItem.right - lpdis->rcItem.left,
lpdis->rcItem.bottom - lpdis->rcItem.top,
hdcMem,0, 0,47,50,SRCCOPY);
return 0;
......
}
here is also a pic if I didn't make myself clear.
the first one is after I put an other window in front of the dialogbox, the second one is the original: