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

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

Advanced Technical Services
615-747-5810
200 Hill Ave
Nashville, TN
Computer Services
615-252-8044
230 Willow St
Nashville, TN
Expeditors International
(901) 362-9771
5395 Distriplex Farms Drive
Memphis, TN
Simple Solutions
(901) 289-0089
4499 Seven Valley Cove
Memphis, TN
Advanced Network Solutions
615-277-0500
105 Broadway
Nashville, TN
Cyberangel Security Solutions Inc
615-837-9191
475 Metroplex DR
Nashville, TN
Peachtree Software Support
615-256-1111
415 4th Ave S
Nashville, TN
C M S Manufacturing Systems
615-662-3102
131 Belle Forest Cir
Nashville, TN
Cbnc LLC
615-831-3270
5360 Edmondson Pike
Nashville, TN
Logical Systems, Inc
(901) 377-5574
7950 Stage Hills Boulevard
Bartlett,, TN

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

Advanced Technical Services

615-747-5810
200 Hill Ave
Nashville, TN

Related Articles
- Advanced C++/CLI Tennessee
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 Tennessee
- Interacting with .NET WinForms, Part 1 Tennessee
- Placing Logo on the Top DockBar of the Frame Window Tennessee
- Extending CPictureHolder for loading BMP, JPG, etc. Tennessee
- ListBox with Grayed Out / Non-Selectable Items Tennessee
- Enumerate NT services Tennessee
- Avoiding Boolean Overload Tennessee
- Visual Basic .NET Attributes Tennessee
- JavaBean Proxies Tennessee
Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Antioch TN
- Code to View/Hide Status Bar in SDI and MDI Applications Ashland City TN
- Code to View/Hide Status Bar in SDI and MDI Applications Brentwood TN
- Code to View/Hide Status Bar in SDI and MDI Applications Bristol TN
- Code to View/Hide Status Bar in SDI and MDI Applications Chattanooga TN
- Code to View/Hide Status Bar in SDI and MDI Applications Clarksville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Cleveland TN
- Code to View/Hide Status Bar in SDI and MDI Applications Collierville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Columbia TN
- Code to View/Hide Status Bar in SDI and MDI Applications Cookeville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Cordova TN
- Code to View/Hide Status Bar in SDI and MDI Applications Crossville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Dickson TN
- Code to View/Hide Status Bar in SDI and MDI Applications Dyersburg TN
- Code to View/Hide Status Bar in SDI and MDI Applications Elizabethton TN
- Code to View/Hide Status Bar in SDI and MDI Applications Franklin TN
- Code to View/Hide Status Bar in SDI and MDI Applications Gallatin TN
- Code to View/Hide Status Bar in SDI and MDI Applications Germantown TN
- Code to View/Hide Status Bar in SDI and MDI Applications Goodlettsville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Greeneville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Harriman TN
- Code to View/Hide Status Bar in SDI and MDI Applications Hendersonville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Hermitage TN
- Code to View/Hide Status Bar in SDI and MDI Applications Hixson TN
- Code to View/Hide Status Bar in SDI and MDI Applications Humboldt TN
- Code to View/Hide Status Bar in SDI and MDI Applications Jackson TN
- Code to View/Hide Status Bar in SDI and MDI Applications Johnson City TN
- Code to View/Hide Status Bar in SDI and MDI Applications Jonesborough TN
- Code to View/Hide Status Bar in SDI and MDI Applications Kingsport TN
- Code to View/Hide Status Bar in SDI and MDI Applications Knoxville TN
- Code to View/Hide Status Bar in SDI and MDI Applications La Follette TN
- Code to View/Hide Status Bar in SDI and MDI Applications La Vergne TN
- Code to View/Hide Status Bar in SDI and MDI Applications Lebanon TN
- Code to View/Hide Status Bar in SDI and MDI Applications Lenoir City TN
- Code to View/Hide Status Bar in SDI and MDI Applications Loudon TN
- Code to View/Hide Status Bar in SDI and MDI Applications Madison TN
- Code to View/Hide Status Bar in SDI and MDI Applications Martin TN
- Code to View/Hide Status Bar in SDI and MDI Applications Maryville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Mc Minnville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Memphis TN
- Code to View/Hide Status Bar in SDI and MDI Applications Millington TN
- Code to View/Hide Status Bar in SDI and MDI Applications Morristown TN
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Juliet TN
- Code to View/Hide Status Bar in SDI and MDI Applications Murfreesboro TN
- Code to View/Hide Status Bar in SDI and MDI Applications Nashville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Oak Ridge TN
- Code to View/Hide Status Bar in SDI and MDI Applications Old Hickory TN
- Code to View/Hide Status Bar in SDI and MDI Applications Ooltewah TN
- Code to View/Hide Status Bar in SDI and MDI Applications Ripley TN
- Code to View/Hide Status Bar in SDI and MDI Applications Rogersville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Sevierville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Shelbyville TN
- Code to View/Hide Status Bar in SDI and MDI Applications Signal Mountain TN
- Code to View/Hide Status Bar in SDI and MDI Applications Smyrna TN
- Code to View/Hide Status Bar in SDI and MDI Applications Soddy Daisy TN
- Code to View/Hide Status Bar in SDI and MDI Applications Tullahoma TN
Related Local Events
Christians In Action Trade Show
Dates: 10/16/2009 - 10/17/2009
Location: Gaylord Opryland Resort & Convention Center
Nashville, TN
View Details

MS PowerPoint 2002 (XP) Level Two
Dates: 7/16/2009 - 7/16/2009
Location: Greater Nashville Association of Realtors
Nashville, TN
View Details

Intergraph 2009
Dates: 6/15/2009 - 6/18/2009
Location: Gaylord Opryland Resort & Convention Center
Nashville, TN
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