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

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

Database Link LLC
303 269 1801
7125 E.Townsend Dr.
Denver, CO
Database Link LLC
303 269 1801
7125 E.Townsend Dr.
Denver, CO
21st Century Technologies, Inc.
303-744-2178
1566 S. Pennsylvania St.
Denver, CO
Rapid Refill Ink
303-292-9465
1719 Wazee St
Denver, CO
International Computer Services
720-859-0404
10 S Havana St
Aurora, CO
The Logix Group
(720) 259-7500
8801 E. Hampden Ave.
Denver, CO
EDUSS Education Software
303-779-8700
8000 E Belleview
Greenwood Village, CO
Amadeus Consulting
720 564 1231
1995 N. 57th Ct.
Boulder, CO
C Graphics
720-890-2911
8547 E. Arapahoe Rd.
Greenwood Village, CO
DENVER DATAMAN
303731-5978
1685 S. Colorado Blvd
Denver, CO

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

Database Link LLC

303 269 1801
7125 E.Townsend Dr.
Denver, CO
http://www.dblink.co.nz

Related Articles
- Advanced C++/CLI Colorado
C++/CLI has a number of advanced features that make developing and maintaining applications easier. Discover how these allow types to be moved between assemblies without breaking existing application, allow fast and efficient interoperability between native functions, and make it possible to create functions that take a variable number of parameters while still maintaining type safety.
- Audio Mixer Control Classes Colorado
- Avoiding Boolean Overload Colorado
- Interacting with .NET WinForms, Part 1 Colorado
- Placing Logo on the Top DockBar of the Frame Window Colorado
- Extending CPictureHolder for loading BMP, JPG, etc. Colorado
- Visual Basic .NET Attributes Colorado
- Enumerate NT services Colorado
- ListBox with Grayed Out / Non-Selectable Items Colorado
- JavaBean Proxies Colorado
Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Arvada CO
- Code to View/Hide Status Bar in SDI and MDI Applications Aurora CO
- Code to View/Hide Status Bar in SDI and MDI Applications Boulder CO
- Code to View/Hide Status Bar in SDI and MDI Applications Brighton CO
- Code to View/Hide Status Bar in SDI and MDI Applications Broomfield CO
- Code to View/Hide Status Bar in SDI and MDI Applications Canon City CO
- Code to View/Hide Status Bar in SDI and MDI Applications Castle Rock CO
- Code to View/Hide Status Bar in SDI and MDI Applications Colorado Springs CO
- Code to View/Hide Status Bar in SDI and MDI Applications Commerce City CO
- Code to View/Hide Status Bar in SDI and MDI Applications Denver CO
- Code to View/Hide Status Bar in SDI and MDI Applications Durango CO
- Code to View/Hide Status Bar in SDI and MDI Applications Englewood CO
- Code to View/Hide Status Bar in SDI and MDI Applications Evergreen CO
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Collins CO
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Morgan CO
- Code to View/Hide Status Bar in SDI and MDI Applications Fountain CO
- Code to View/Hide Status Bar in SDI and MDI Applications Golden CO
- Code to View/Hide Status Bar in SDI and MDI Applications Grand Junction CO
- Code to View/Hide Status Bar in SDI and MDI Applications Greeley CO
- Code to View/Hide Status Bar in SDI and MDI Applications Lafayette CO
- Code to View/Hide Status Bar in SDI and MDI Applications Littleton CO
- Code to View/Hide Status Bar in SDI and MDI Applications Longmont CO
- Code to View/Hide Status Bar in SDI and MDI Applications Loveland CO
- Code to View/Hide Status Bar in SDI and MDI Applications Montrose CO
- Code to View/Hide Status Bar in SDI and MDI Applications Morrison CO
- Code to View/Hide Status Bar in SDI and MDI Applications Parker CO
- Code to View/Hide Status Bar in SDI and MDI Applications Pueblo CO
- Code to View/Hide Status Bar in SDI and MDI Applications Sterling CO
- Code to View/Hide Status Bar in SDI and MDI Applications Westminster CO
- Code to View/Hide Status Bar in SDI and MDI Applications Wheat Ridge CO
Related Articles
- Advanced C++/CLI Colorado
C++/CLI has a number of advanced features that make developing and maintaining applications easier. Discover how these allow types to be moved between assemblies without breaking existing application, allow fast and efficient interoperability between native functions, and make it possible to create functions that take a variable number of parameters while still maintaining type safety.
- Audio Mixer Control Classes Colorado
- Avoiding Boolean Overload Colorado
- Interacting with .NET WinForms, Part 1 Colorado
- Placing Logo on the Top DockBar of the Frame Window Colorado
- Extending CPictureHolder for loading BMP, JPG, etc. Colorado
- Visual Basic .NET Attributes Colorado
- Enumerate NT services Colorado
- ListBox with Grayed Out / Non-Selectable Items Colorado
- JavaBean Proxies Colorado
Related Local Events
SEG - Society of Exploration Geophysicists Annual International Meeting and Exposition 2010
Dates: 10/17/2010 - 10/21/2010
Location: Denver Convention Center
Denver, CO
View Details

INTC 2009
Dates: 9/21/2009 - 9/24/2009
Location: Hyatt Convention Center Hotel
Denver, CO
View Details

RetailVision Fall 2009
Dates: 8/30/2009 - 9/3/2009
Location: Hyatt Regency Denver
Denver, CO
View Details

SANS Rocky Mountain 2009
Dates: 7/7/2009 - 7/13/2009
Location: Grand Hyatt Denver
Denver, CO
View Details

15th International Conference on Solid-State Sensors, Actuators and Microsystems (Transducers 2009)
Dates: 6/21/2009 - 6/25/2009
Location: Sheraton Denver Downtown Hotel
Denver, CO
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