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

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

Disaster Recovery By CCP
410-247-7000
4367 Hollins Ferry Rd Suite 2B
Baltimore, MD
A E C Solutions
410-823-5007
6510 Falls RD
Baltimore, MD
Legal Technology Solutions
410-547-8596
36 S Charles St
Baltimore, MD
USinternetworking, An AT&T Company
410-897-3506
2500 Riva Road
Annapolis, MD
Universal Software Solutions Inc
410-358-8851
6506 Cross Country Blvd
Baltimore, MD
Early Morning Software Inc
410-539-0901
227 Holliday St
Baltimore, MD
Gp Solutions Inc
410-244-8548
201 N Charles St
Baltimore, MD
Affiliated Computer Services Inc
410-347-0794
200 Holliday St
Baltimore, MD
HypeOffice
1.301.255.0018
6101 Executive Blvd. #115
Rockville, MD
Accessing Cadd
410-296-0888
2545 Wilkens Ave
Baltimore, MD

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

Disaster Recovery By CCP

410-247-7000
4367 Hollins Ferry Rd Suite 2B
Baltimore, MD
http://www.ccp-solutions.com

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Annapolis MD
- Code to View/Hide Status Bar in SDI and MDI Applications Baltimore MD
- Code to View/Hide Status Bar in SDI and MDI Applications Bel Air MD
- Code to View/Hide Status Bar in SDI and MDI Applications Beltsville MD
- Code to View/Hide Status Bar in SDI and MDI Applications Bethesda MD
- Code to View/Hide Status Bar in SDI and MDI Applications Bowie MD
- Code to View/Hide Status Bar in SDI and MDI Applications Brooklyn MD
- Code to View/Hide Status Bar in SDI and MDI Applications Capitol Heights MD
- Code to View/Hide Status Bar in SDI and MDI Applications Catonsville MD
- Code to View/Hide Status Bar in SDI and MDI Applications Chevy Chase MD
- Code to View/Hide Status Bar in SDI and MDI Applications Clinton MD
- Code to View/Hide Status Bar in SDI and MDI Applications Cockeysville MD
- Code to View/Hide Status Bar in SDI and MDI Applications College Park MD
- Code to View/Hide Status Bar in SDI and MDI Applications Columbia MD
- Code to View/Hide Status Bar in SDI and MDI Applications Crofton MD
- Code to View/Hide Status Bar in SDI and MDI Applications Cumberland MD
- Code to View/Hide Status Bar in SDI and MDI Applications Derwood MD
- Code to View/Hide Status Bar in SDI and MDI Applications District Heights MD
- Code to View/Hide Status Bar in SDI and MDI Applications Dundalk MD
- Code to View/Hide Status Bar in SDI and MDI Applications Edgewood MD
- Code to View/Hide Status Bar in SDI and MDI Applications Elkridge MD
- Code to View/Hide Status Bar in SDI and MDI Applications Elkton MD
- Code to View/Hide Status Bar in SDI and MDI Applications Ellicott City MD
- Code to View/Hide Status Bar in SDI and MDI Applications Essex MD
- Code to View/Hide Status Bar in SDI and MDI Applications Forest Hill MD
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Washington MD
- Code to View/Hide Status Bar in SDI and MDI Applications Frederick MD
- Code to View/Hide Status Bar in SDI and MDI Applications Frostburg MD
- Code to View/Hide Status Bar in SDI and MDI Applications Gaithersburg MD
- Code to View/Hide Status Bar in SDI and MDI Applications Germantown MD
- Code to View/Hide Status Bar in SDI and MDI Applications Glen Burnie MD
- Code to View/Hide Status Bar in SDI and MDI Applications Greenbelt MD
- Code to View/Hide Status Bar in SDI and MDI Applications Gwynn Oak MD
- Code to View/Hide Status Bar in SDI and MDI Applications Hagerstown MD
- Code to View/Hide Status Bar in SDI and MDI Applications Halethorpe MD
- Code to View/Hide Status Bar in SDI and MDI Applications Havre De Grace MD
- Code to View/Hide Status Bar in SDI and MDI Applications Hyattsville MD
- Code to View/Hide Status Bar in SDI and MDI Applications Jessup MD
- Code to View/Hide Status Bar in SDI and MDI Applications Joppa MD
- Code to View/Hide Status Bar in SDI and MDI Applications Kensington MD
- Code to View/Hide Status Bar in SDI and MDI Applications La Plata MD
- Code to View/Hide Status Bar in SDI and MDI Applications Lanham MD
- Code to View/Hide Status Bar in SDI and MDI Applications Laurel MD
- Code to View/Hide Status Bar in SDI and MDI Applications Lexington Park MD
- Code to View/Hide Status Bar in SDI and MDI Applications Lusby MD
- Code to View/Hide Status Bar in SDI and MDI Applications Lutherville Timonium MD
- Code to View/Hide Status Bar in SDI and MDI Applications Middle River MD
- Code to View/Hide Status Bar in SDI and MDI Applications Millersville MD
- Code to View/Hide Status Bar in SDI and MDI Applications Montgomery Village MD
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Airy MD
- Code to View/Hide Status Bar in SDI and MDI Applications Nottingham MD
- Code to View/Hide Status Bar in SDI and MDI Applications Odenton MD
- Code to View/Hide Status Bar in SDI and MDI Applications Olney MD
- Code to View/Hide Status Bar in SDI and MDI Applications Owings Mills MD
- Code to View/Hide Status Bar in SDI and MDI Applications Oxon Hill MD
- Code to View/Hide Status Bar in SDI and MDI Applications Parkville MD
- Code to View/Hide Status Bar in SDI and MDI Applications Pasadena MD
- Code to View/Hide Status Bar in SDI and MDI Applications Pikesville MD
- Code to View/Hide Status Bar in SDI and MDI Applications Potomac MD
- Code to View/Hide Status Bar in SDI and MDI Applications Randallstown MD
- Code to View/Hide Status Bar in SDI and MDI Applications Reisterstown MD
- Code to View/Hide Status Bar in SDI and MDI Applications Rockville MD
- Code to View/Hide Status Bar in SDI and MDI Applications Rosedale MD
- Code to View/Hide Status Bar in SDI and MDI Applications Salisbury MD
- Code to View/Hide Status Bar in SDI and MDI Applications Severn MD
- Code to View/Hide Status Bar in SDI and MDI Applications Severna Park MD
- Code to View/Hide Status Bar in SDI and MDI Applications Silver Spring MD
- Code to View/Hide Status Bar in SDI and MDI Applications Suitland MD
- Code to View/Hide Status Bar in SDI and MDI Applications Sykesville MD
- Code to View/Hide Status Bar in SDI and MDI Applications Takoma Park MD
- Code to View/Hide Status Bar in SDI and MDI Applications Temple Hills MD
- Code to View/Hide Status Bar in SDI and MDI Applications Towson MD
- Code to View/Hide Status Bar in SDI and MDI Applications Upper Marlboro MD
- Code to View/Hide Status Bar in SDI and MDI Applications Waldorf MD
- Code to View/Hide Status Bar in SDI and MDI Applications Westminster MD
- Code to View/Hide Status Bar in SDI and MDI Applications Windsor Mill MD
Related Local Events
National Facilities Management & Technology (NFMT)
Dates: 3/16/2010 - 3/28/2010
Location: Baltimore Convention Center
Baltimore, MD
View Details

CSI 2009: The Next Phase In Security
Dates: 10/24/2009 - 10/30/2009
Location: Gaylord National Resort and Convention Center
National Harbor, MD
View Details

E-Tail Baltimore
Dates: 8/3/2009 - 8/6/2009
Location: Hilton Baltimore
Baltimore, MD
View Details

Gartner IT Security Summit Washington
Dates: 6/27/2009 - 6/28/2009
Location: Gaylord National Hotel & Convention Center
National Harbor, MD
View Details

Indian Head Division/Naval Surface Warfare Center (NSWC) Technology Transfer Showcase
Dates: 6/25/2009 - 6/25/2009
Location: The Village Green Pavilion
Indian Head, MD
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