Code to View/Hide Status Bar in SDI and MDI Applications Arizona

Here's a little handler for the OnViewStatusBar message handler to change the "View/Hide Status Bar" menu option so that the application (main) window changes its height according to the size of the visible client area.

Local Companies

JDR Consulting
480-491-4756
1660 S. Alma School Rd. Ste 223
Mesa, AZ
Aya Solutions
480-833-1727
1955 E Hackamore St
Mesa, AZ
Multi Edit Software Inc
480-610-2700
7532 E Dulciana Cir
Mesa, AZ
Alphasource Technologies Inc Inc
520-620-6888
3120 W Corte Olivia
Tucson, AZ
Component Software Inc
480-496-9303
5831 W Kesler St
Chandler, AZ
Synapps LLC
(480) 664-6071
4649 E Carriage Ct
Gilbert, AZ
Vertex Inc
(480) 283-8600
2961 E Marlene Dr
Gilbert, AZ
Wizard Computer Services
(480) 926-3144
2104 E Freeport Ln
Gilbert, AZ
Lone Wolf Software Inc.
(623) 824-1140
6097 N 57th Drive
Glendale, AZ
BBB Systems, LLC
(602) 424-0914
2340 W. Mission
Phoenix, AZ

provided by: 
Originally published at Internet.com


Ever wanted to change the "View/Hide Status Bar" menu option so that the application (main) window changes its height accordingly preserving the size of the visible client area?

Here's a little handler for the OnViewStatusBar message handler to perform this task. Versions for MFC or Non-MFC available. // // OnViewStatusBar handler // // increase or decrease app window height to adapt to // visible or invisible status bar // void CMainFrame::OnViewStatusBar() // MFC version // by Volker Bartheld { CControlBar* pBar = GetControlBar(AFX_IDW_STATUS_BAR); if (pBar != NULL) { RECT AppWinRect, BarRect; GetWindowRect(&AppWinRect); pBar->GetWindowRect(&BarRect); int iBarHeight = BarRect.bottom - BarRect.top; BOOL bShow = (pBar->GetStyle() & WS_VISIBLE) == 0; ShowControlBar(pBar, bShow, FALSE); if (bShow) { // ... increase frame SetWindowPos(&CWnd::wndNoTopMost, AppWinRect.top, AppWinRect.left, AppWinRect.right-AppWinRect.left, AppWinRect.bottom- AppWinRect.top+iBarHeight, SWP_NOMOVE); } else { // ... decrease frame SetWindowPos(&CWnd::wndNoTopMost, AppWinRect.top, AppWinRect.left, AppWinRect.right-AppWinRect.left, AppWinRect.bottom-AppWinRect.top- iBarHeight, SWP_NOMOVE); } } } void CMainFrame::OnViewStatusBar() // non-MFC-version // by Alexander Sailer { // MFC StatusbarHandler aufrufen OnBarCheck(ID_VIEW_STATUS_BAR); CControlBar* pBar = NULL; BOOL bVisible(false); RECT AppWinRect, BarRect; int iBarHeight(0); // get ptr to status bar pBar = GetControlBar(ID_VIEW_STATUS_BAR); ASSERT(pBar); // Abme_ungen holen GetWindowRect(&AppWinRect); pBar->GetWindowRect(&BarRect); iBarHeight = BarRect.bottom - BarRect.top; // Abfrage ob Bar sichtbar ist bVisible = pBar->IsVisible(); if (bVisible)// ... increase frame { SetWindowPos(&CWnd::wndNoTopMost, AppWinRect.top, AppWinRect.left, AppWinRect.right-AppWinRect.left, AppWinRect.bottom-AppWinRect.top+iBarHeight, SWP_NOMOVE); } else // ... decrease frame { SetWindowPos(&CWnd::wndNoTopMost, AppWinRect.top, AppWinRect.left, AppWinRect.right-AppWinRect.left, AppWinRect.bottom-AppWinRect.top-iBarHeight, SWP_NOMOVE); } }

Downloads

Download source - 1 Kb

Author: Volker Bartheld

Read article at Internet.com site

Featured Local Company

JDR Consulting

480-491-4756
1660 S. Alma School Rd. Ste 223
Mesa, AZ
http://www.jdrconsulting.com

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Apache Junction AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Avondale AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Buckeye AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Bullhead City AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Casa Grande AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Cave Creek AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Chandler AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Cottonwood AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Flagstaff AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Fountain Hills AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Gilbert AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Glendale AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Goodyear AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Green Valley AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Kingman AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Lake Havasu City AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Mesa AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Paradise Valley AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Peoria AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Phoenix AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Prescott AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Prescott Valley AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Safford AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Scottsdale AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Sedona AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Sierra Vista AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Somerton AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Sun City AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Sun City West AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Surprise AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Tempe AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Tucson AZ
- Code to View/Hide Status Bar in SDI and MDI Applications Yuma AZ
Related Local Events
Toastmasters
Dates: 11/26/2009 - 11/26/2009
Location: Peoria Chamber of Commerce
Peoria, AZ
View Details

The Big Draw VI
Dates: 12/1/2009 - 12/1/2009
Location: The Crown Room
Scottsdale, AZ
View Details

Toastmasters
Dates: 1/7/2010 - 1/7/2010
Location: Peoria Chamber of Commerce
Peoria, AZ
View Details

Toastmasters
Dates: 2/4/2010 - 2/4/2010
Location: Peoria Chamber of Commerce
Peoria, AZ
View Details

Toastmasters
Dates: 3/25/2010 - 3/25/2010
Location: Peoria Chamber of Commerce
Peoria, AZ
View Details

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML