Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non Client area drawing/calculating problem

Status
Not open for further replies.

LuckyLuke

Programmer
Mar 28, 2001
188
NL
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 found out that the problem lies somewhere else. I create the 3 windows with a height of 150. If this height changes, thus when moving the window, there are somehow no WM_NCCALCSIZE messages sent to that window with the wParam parameter set to FALSE. Anyone got any idea what the problem of this could be?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top