开发者

How do I get the paintable area in a CFrameWnd with dialog bars?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜