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

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

American Computer Services
(515) 251-7340
2183 NW 86th St Ste B
Des Moines, IA
Cedar Valley Information Technology Services
(319) 235-2724
531 Commercial St
Waterloo, IA
Global Tech Services
(515) 267-9097
5058 Grand Ridge Dr
West Des Moines, IA
Msi Systems Inc
(515) 225-8077
2600 Westown Pkwy Ste 210
West Des Moines, IA
Nettech Consulting
(319) 465-6082
Monticello, IA
Maximum Consulting Inc
(515) 987-3540
Waukee, IA
Starken Group Ltd the
(319) 247-4825
1220 Industrial Ave Ste A
Hiawatha, IA
Big Creek Software Llc
(515) 984-6243
201 N 3rd St
Polk City, IA
Professional Project Partners
(515) 987-9998
3201 150th St
Urbandale, IA
Data Systems Development
(563) 285-8328
205 Shawnee Cir
Eldridge, IA

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
Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Ames IA
- Code to View/Hide Status Bar in SDI and MDI Applications Ankeny IA
- Code to View/Hide Status Bar in SDI and MDI Applications Bettendorf IA
- Code to View/Hide Status Bar in SDI and MDI Applications Burlington IA
- Code to View/Hide Status Bar in SDI and MDI Applications Cedar Falls IA
- Code to View/Hide Status Bar in SDI and MDI Applications Cedar Rapids IA
- Code to View/Hide Status Bar in SDI and MDI Applications Clinton IA
- Code to View/Hide Status Bar in SDI and MDI Applications Coralville IA
- Code to View/Hide Status Bar in SDI and MDI Applications Council Bluffs IA
- Code to View/Hide Status Bar in SDI and MDI Applications Davenport IA
- Code to View/Hide Status Bar in SDI and MDI Applications Des Moines IA
- Code to View/Hide Status Bar in SDI and MDI Applications Dubuque IA
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Dodge IA
- Code to View/Hide Status Bar in SDI and MDI Applications Indianola IA
- Code to View/Hide Status Bar in SDI and MDI Applications Iowa City IA
- Code to View/Hide Status Bar in SDI and MDI Applications Marion IA
- Code to View/Hide Status Bar in SDI and MDI Applications Marshalltown IA
- Code to View/Hide Status Bar in SDI and MDI Applications Mason City IA
- Code to View/Hide Status Bar in SDI and MDI Applications Muscatine IA
- Code to View/Hide Status Bar in SDI and MDI Applications Oskaloosa IA
- Code to View/Hide Status Bar in SDI and MDI Applications Ottumwa IA
- Code to View/Hide Status Bar in SDI and MDI Applications Sioux City IA
- Code to View/Hide Status Bar in SDI and MDI Applications Urbandale IA
- Code to View/Hide Status Bar in SDI and MDI Applications Waterloo IA
- Code to View/Hide Status Bar in SDI and MDI Applications West Des Moines IA
Related Local Events
Chamber Coffee - Vantus Bank
Dates: 11/18/2009 - 11/18/2009
Location: Le Mars Chamber of Commerce
Le Mars, IA
View Details

Chamber Coffee - The Living Center
Dates: 11/11/2009 - 11/11/2009
Location: Le Mars Chamber of Commerce
Le Mars, IA
View Details

8/14/09 - Technology and Professional Communication Capatibility
Dates: 8/14/2009 - 8/14/2009
Location: TS Bank Solution Center
Council Bluffs, IA
View Details

University of Okoboji 3.5 Open Water Swim
Dates: 8/1/2009 - 8/1/2009
Location: Pikes Point,
Okoboji, IA
View Details

ArtsLIVE Yourth Festival
Dates: 7/20/2009 - 7/20/2009
Location: Camp Foster YMCA
Spirit Lake, IA
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