开发者

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

开发者 https://www.devze.com 2023-01-08 12:53 出处:网络
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

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

精彩评论

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