I have a CFrameWnd with a dialog bar, and I'd like to determine the paintable area (ex开发者_Go百科cluding 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.
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);
I had a similar problem with CDockablePane which I solved with
CRect rc;
GetDockingManager()->GetClientAreaBounds(rc);
but I also ran into the problem of not being able to find a message or callback to know when to trigger it.
精彩评论