How to get dimensions of client area without toolbars?
-
Hi, How can I get the position and dimension of my client area inside of my CFrameWnd without including the area of docked tool bars or status bars? Thanks :)
The docked toolbars sit inside a child window, if you could find that, you could get it's size and subtract it from GetClientRect. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002 -
The docked toolbars sit inside a child window, if you could find that, you could get it's size and subtract it from GetClientRect. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002Thank you Christian, I tried that, but when the toolBar is docked, it seems that the dimensions obtained with GetClientRect don't match the docking area. Also if I have several toolBars I have to check each single toolBar's status (docked or floating) and then its dimensions. Also what happens if several toolBars dock together on more than one row?
-
Thank you Christian, I tried that, but when the toolBar is docked, it seems that the dimensions obtained with GetClientRect don't match the docking area. Also if I have several toolBars I have to check each single toolBar's status (docked or floating) and then its dimensions. Also what happens if several toolBars dock together on more than one row?
The child window that holds the toolbars is called a CMiniDockFrameWnd. You need to find those, and grab their dimensions, I think. Or create a View, maximise it, and get IT'S dimensions. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002 -
The child window that holds the toolbars is called a CMiniDockFrameWnd. You need to find those, and grab their dimensions, I think. Or create a View, maximise it, and get IT'S dimensions. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002 -
Hi, How can I get the position and dimension of my client area inside of my CFrameWnd without including the area of docked tool bars or status bars? Thanks :)
There is a CWnd member called RepositionBars. You can call it like this:
CRect a_oRealClientArea( 0, 0, 0, 0 );
pYourFrameWnd->RepositionBars( AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, CWnd::reposQuery, &a_oRealClientArea, NULL, FALSE );Chris Richardson Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
-
There is a CWnd member called RepositionBars. You can call it like this:
CRect a_oRealClientArea( 0, 0, 0, 0 );
pYourFrameWnd->RepositionBars( AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, CWnd::reposQuery, &a_oRealClientArea, NULL, FALSE );Chris Richardson Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
-
No problem, I'm glad to hear it's working! :) Chris Richardson Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith