本文整理汇总了C++中CStatusBar::GetWindowRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CStatusBar::GetWindowRect方法的具体用法?C++ CStatusBar::GetWindowRect怎么用?C++ CStatusBar::GetWindowRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStatusBar
的用法示例。
在下文中一共展示了CStatusBar::GetWindowRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResizeToMovie
void CMainFrame::ResizeToMovie(RECT movierect)
{
// TODO: Add your command handler code here
CRect clientrect;
CRect windowrect;
CRect toolbarrect;
CRect statusbarrect;
GetWindowRect( &windowrect);
GetClientRect( &clientrect);
m_wndToolBar.GetWindowRect(&toolbarrect);
CStatusBar* pStatus = (CStatusBar*) AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
pStatus->GetWindowRect(&statusbarrect);
int borderHeight = GetSystemMetrics(SM_CYBORDER);
int borderWidth = GetSystemMetrics(SM_CXBORDER);
int captionHeight = GetSystemMetrics(SM_CYCAPTION);
//Dock Toolbar
// @FIXME[Carlo Lanzotti]: No need to call this unless the tool bar are set to be dockable.
//DockControlBar(&m_wndToolBar);
//Menu Height
int menuY = GetSystemMetrics(SM_CYMENU);
CWnd* mainWindow = AfxGetMainWnd( );
AdjustWindowRectEx(&movierect, GetWindowLong(mainWindow->m_hWnd, GWL_STYLE), TRUE, GetWindowLong(mainWindow->m_hWnd, GWL_EXSTYLE));
int compactcx = movierect.right-movierect.left + 1 + 4;
int compactcy = movierect.bottom-movierect.top + 1 + toolbarrect.Height() +statusbarrect.Height() + 4;
//compactcx += 2;
//compactcy += 2;
//if (compactcx > 600) compactcx=600;
//if (compactcy > 480) compactcy=480;
if (compactcx > maxxScreen - windowrect.left) {
windowrect.left = maxxScreen - compactcx;
}
if (compactcy > maxyScreen - windowrect.top) {
windowrect.top = maxyScreen - compactcy - 20; //20 to compensate for taskbar height
}
if (windowrect.left<=0) {
windowrect.left = 1;
}
if (windowrect.top<=0) {
windowrect.top = 1;
}
SetWindowPos( &wndTop, windowrect.left, windowrect.top, compactcx, compactcy, SWP_SHOWWINDOW);
}