Hi,
I've registered and created my own controls succesfully. In the windowclass style I've specified CS_OWNDC for drawing purposes. The control should have a non client area and therefore in response to the WM_NCCALCSIZE message I have this code:
[tt]
if (!wParam)
{
lprc = (LPRECT) lParam;
SetRect(lprc, lprc->left + 4, lprc->top + 20, lprc->right - 4, lprc->bottom - 3);
}
return 0;
[/tt]
This works fine, the client area gets exactly the way I want it (I don't think this is the right way however; according to MSDN you should change the client area if wParam == TRUE, but that doesn't work for me. So if you know how to do it that way, please say so ).
Drawing also goes fine, until I resize the window. I have 3 windows of this class, 2 are static and don't move and the 3rd moves. The first 2 are drawn the way it should, the 3rd also, but the drawings get erased through the WM_ERASEBKGND message. If I check the client area during the WM_ERASEBKGND message, I notice that it is the same as the window area. However if I check the client area of the non resizing controls, I see that the client area and the window area are as they should be.
Any input on this problem is welcome
I've registered and created my own controls succesfully. In the windowclass style I've specified CS_OWNDC for drawing purposes. The control should have a non client area and therefore in response to the WM_NCCALCSIZE message I have this code:
[tt]
if (!wParam)
{
lprc = (LPRECT) lParam;
SetRect(lprc, lprc->left + 4, lprc->top + 20, lprc->right - 4, lprc->bottom - 3);
}
return 0;
[/tt]
This works fine, the client area gets exactly the way I want it (I don't think this is the right way however; according to MSDN you should change the client area if wParam == TRUE, but that doesn't work for me. So if you know how to do it that way, please say so ).
Drawing also goes fine, until I resize the window. I have 3 windows of this class, 2 are static and don't move and the 3rd moves. The first 2 are drawn the way it should, the 3rd also, but the drawings get erased through the WM_ERASEBKGND message. If I check the client area during the WM_ERASEBKGND message, I notice that it is the same as the window area. However if I check the client area of the non resizing controls, I see that the client area and the window area are as they should be.
Any input on this problem is welcome