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

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

Westglenn Software
205-870-3118
2100 Southbridge Pkwy
Birmingham, AL
Arbitron Inc
205-977-6100
3500 Colonnade Pkwy
Birmingham, AL
eClinicalworks EMR Software
+1-395-685-7896
218 Mount Holly
California, AL
Ihs Inc Software
205-408-1477
4945 Mountain View Pkwy
Birmingham, AL
Visual Solutions Inc
205-930-5540
2217 10th CT S
Birmingham, AL
J K Preg Illustration
(334) 613-9993
2704 Colonial Dr
Montgomery, AL
Priority Software
205-838-7061
9006 4th Ave S
Birmingham, AL
Achaia Solutions
205-437-9960
117 Narrows Creek DR
Birmingham, AL
Exact Software North America
205-980-5270
3000 Eagle Point Corporate DR
Birmingham, AL
J R M Software
205-982-1836
209 Royal Oaks DR
Birmingham, AL

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

Westglenn Software

205-870-3118
2100 Southbridge Pkwy
Birmingham, AL

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Alabaster AL
- Code to View/Hide Status Bar in SDI and MDI Applications Albertville AL
- Code to View/Hide Status Bar in SDI and MDI Applications Alexander City AL
- Code to View/Hide Status Bar in SDI and MDI Applications Andalusia AL
- Code to View/Hide Status Bar in SDI and MDI Applications Anniston AL
- Code to View/Hide Status Bar in SDI and MDI Applications Arab AL
- Code to View/Hide Status Bar in SDI and MDI Applications Athens AL
- Code to View/Hide Status Bar in SDI and MDI Applications Atmore AL
- Code to View/Hide Status Bar in SDI and MDI Applications Auburn AL
- Code to View/Hide Status Bar in SDI and MDI Applications Bay Minette AL
- Code to View/Hide Status Bar in SDI and MDI Applications Bessemer AL
- Code to View/Hide Status Bar in SDI and MDI Applications Birmingham AL
- Code to View/Hide Status Bar in SDI and MDI Applications Boaz AL
- Code to View/Hide Status Bar in SDI and MDI Applications Brewton AL
- Code to View/Hide Status Bar in SDI and MDI Applications Clanton AL
- Code to View/Hide Status Bar in SDI and MDI Applications Cullman AL
- Code to View/Hide Status Bar in SDI and MDI Applications Daphne AL
- Code to View/Hide Status Bar in SDI and MDI Applications Decatur AL
- Code to View/Hide Status Bar in SDI and MDI Applications Dothan AL
- Code to View/Hide Status Bar in SDI and MDI Applications Enterprise AL
- Code to View/Hide Status Bar in SDI and MDI Applications Eufaula AL
- Code to View/Hide Status Bar in SDI and MDI Applications Fairhope AL
- Code to View/Hide Status Bar in SDI and MDI Applications Florence AL
- Code to View/Hide Status Bar in SDI and MDI Applications Foley AL
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Payne AL
- Code to View/Hide Status Bar in SDI and MDI Applications Gadsden AL
- Code to View/Hide Status Bar in SDI and MDI Applications Guntersville AL
- Code to View/Hide Status Bar in SDI and MDI Applications Haleyville AL
- Code to View/Hide Status Bar in SDI and MDI Applications Hartselle AL
- Code to View/Hide Status Bar in SDI and MDI Applications Huntsville AL
- Code to View/Hide Status Bar in SDI and MDI Applications Jasper AL
- Code to View/Hide Status Bar in SDI and MDI Applications Madison AL
- Code to View/Hide Status Bar in SDI and MDI Applications Mobile AL
- Code to View/Hide Status Bar in SDI and MDI Applications Montevallo AL
- Code to View/Hide Status Bar in SDI and MDI Applications Montgomery AL
- Code to View/Hide Status Bar in SDI and MDI Applications Muscle Shoals AL
- Code to View/Hide Status Bar in SDI and MDI Applications Northport AL
- Code to View/Hide Status Bar in SDI and MDI Applications Opelika AL
- Code to View/Hide Status Bar in SDI and MDI Applications Pelham AL
- Code to View/Hide Status Bar in SDI and MDI Applications Pell City AL
- Code to View/Hide Status Bar in SDI and MDI Applications Phenix City AL
- Code to View/Hide Status Bar in SDI and MDI Applications Pinson AL
- Code to View/Hide Status Bar in SDI and MDI Applications Prattville AL
- Code to View/Hide Status Bar in SDI and MDI Applications Scottsboro AL
- Code to View/Hide Status Bar in SDI and MDI Applications Selma AL
- Code to View/Hide Status Bar in SDI and MDI Applications Semmes AL
- Code to View/Hide Status Bar in SDI and MDI Applications Sylacauga AL
- Code to View/Hide Status Bar in SDI and MDI Applications Talladega AL
- Code to View/Hide Status Bar in SDI and MDI Applications Theodore AL
- Code to View/Hide Status Bar in SDI and MDI Applications Trussville AL
- Code to View/Hide Status Bar in SDI and MDI Applications Tuscaloosa AL
- Code to View/Hide Status Bar in SDI and MDI Applications Tuscumbia AL
- Code to View/Hide Status Bar in SDI and MDI Applications Valley AL
- Code to View/Hide Status Bar in SDI and MDI Applications Wetumpka AL
Related Local Events
December 2009 Gulf Coast Technology Council Meeting
Dates: 12/16/2009 - 12/16/2009
Location: ITT Technical Institute
Mobile, AL
View Details

Going Green Awards
Dates: 10/1/2009 - 10/1/2009
Location: Sheraton
North Birmingham, AL
View Details

Java Jam
Dates: 9/10/2009 - 9/10/2009
Location: Hartselle Chamber of Commerce
Hartselle, AL
View Details

Farmers Telecommunications Cooperative:55th Annual Meeting
Dates: 8/1/2009 - 8/1/2009
Location: DeKalb County Schools Coliseum
Rainsville, AL
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