views:

18

answers:

1

I have a CFrameWnd with a dialog bar, and I'd like to determine the paintable area (excluding the space used by the dialog bar) so I can draw in it without being overlapped by the dialog bar. How can I do this? GetClientRect() seems to cover the client rect area as well, and I don't see any other obvious candiates in the doucumentation.

+1  A: 

I'm pretty sure the Cwnd::RepositionBars method should provide the information you need. Does the following code work for you?

CRect rcClient;
pFrameWnd->RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, CWnd::reposQuery, &rcClient);
flashk
That looks like what I might need - can't test until tomorrow though. Is there a window message or callback that I can use to determine when a toolbar is moved so I can recalculate the client rect then, instead of calling it on every `WM_PAINT`?
bdonlan