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

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

IBM Corp
(757) 446-6200
999 Waterside DR
Norfolk, VA
Digital Image Technology Corp
(757) 623-3709
500 E Plume St
Norfolk, VA
Electronics Boutique
757-465-5977
4200 Portsmouth Blvd
Chesapeake, VA
Paramount Technology Group Inc
757-405-0110
3909 Colony Pointe DR
Chesapeake, VA
Active Computer & Electronics
757-558-8878
2981 S Military Hwy
Chesapeake, VA
Software Development & Services Corporation
703-359-1380
2200 Wilson Blvd
Arlington, VA
Geeks On Call America
(757) 722-3200
814 Kempsville Rd
Norfolk, VA
Patriot Computers
(757) 587-6400
7862 Tidewater Dr
Norfolk, VA
Direct2U Computer Repair
757-803-8126
4213 Schooner Trail
Chesapeake, VA
Torrential Data Solutions Inc
757-222-2000
5604 Virginia Beach Blvd
Virginia Beach, VA

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

IBM Corp

(757) 446-6200
999 Waterside DR
Norfolk, VA

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Alexandria VA
- Code to View/Hide Status Bar in SDI and MDI Applications Annandale VA
- Code to View/Hide Status Bar in SDI and MDI Applications Arlington VA
- Code to View/Hide Status Bar in SDI and MDI Applications Ashburn VA
- Code to View/Hide Status Bar in SDI and MDI Applications Bassett VA
- Code to View/Hide Status Bar in SDI and MDI Applications Blacksburg VA
- Code to View/Hide Status Bar in SDI and MDI Applications Bristol VA
- Code to View/Hide Status Bar in SDI and MDI Applications Burke VA
- Code to View/Hide Status Bar in SDI and MDI Applications Centreville VA
- Code to View/Hide Status Bar in SDI and MDI Applications Chantilly VA
- Code to View/Hide Status Bar in SDI and MDI Applications Charlottesville VA
- Code to View/Hide Status Bar in SDI and MDI Applications Chesapeake VA
- Code to View/Hide Status Bar in SDI and MDI Applications Chester VA
- Code to View/Hide Status Bar in SDI and MDI Applications Chesterfield VA
- Code to View/Hide Status Bar in SDI and MDI Applications Christiansburg VA
- Code to View/Hide Status Bar in SDI and MDI Applications Colonial Heights VA
- Code to View/Hide Status Bar in SDI and MDI Applications Culpeper VA
- Code to View/Hide Status Bar in SDI and MDI Applications Danville VA
- Code to View/Hide Status Bar in SDI and MDI Applications Dumfries VA
- Code to View/Hide Status Bar in SDI and MDI Applications Fairfax Station VA
- Code to View/Hide Status Bar in SDI and MDI Applications Fairfax VA
- Code to View/Hide Status Bar in SDI and MDI Applications Falls Church VA
- Code to View/Hide Status Bar in SDI and MDI Applications Farmville VA
- Code to View/Hide Status Bar in SDI and MDI Applications Fredericksburg VA
- Code to View/Hide Status Bar in SDI and MDI Applications Front Royal VA
- Code to View/Hide Status Bar in SDI and MDI Applications Galax VA
- Code to View/Hide Status Bar in SDI and MDI Applications Glen Allen VA
- Code to View/Hide Status Bar in SDI and MDI Applications Hampton VA
- Code to View/Hide Status Bar in SDI and MDI Applications Harrisonburg VA
- Code to View/Hide Status Bar in SDI and MDI Applications Herndon VA
- Code to View/Hide Status Bar in SDI and MDI Applications Hopewell VA
- Code to View/Hide Status Bar in SDI and MDI Applications King George VA
- Code to View/Hide Status Bar in SDI and MDI Applications Leesburg VA
- Code to View/Hide Status Bar in SDI and MDI Applications Lorton VA
- Code to View/Hide Status Bar in SDI and MDI Applications Lynchburg VA
- Code to View/Hide Status Bar in SDI and MDI Applications Manassas VA
- Code to View/Hide Status Bar in SDI and MDI Applications Martinsville VA
- Code to View/Hide Status Bar in SDI and MDI Applications Mc Lean VA
- Code to View/Hide Status Bar in SDI and MDI Applications Mechanicsville VA
- Code to View/Hide Status Bar in SDI and MDI Applications Midlothian VA
- Code to View/Hide Status Bar in SDI and MDI Applications Newport News VA
- Code to View/Hide Status Bar in SDI and MDI Applications Norfolk VA
- Code to View/Hide Status Bar in SDI and MDI Applications Petersburg VA
- Code to View/Hide Status Bar in SDI and MDI Applications Portsmouth VA
- Code to View/Hide Status Bar in SDI and MDI Applications Powhatan VA
- Code to View/Hide Status Bar in SDI and MDI Applications Radford VA
- Code to View/Hide Status Bar in SDI and MDI Applications Reston VA
- Code to View/Hide Status Bar in SDI and MDI Applications Richmond VA
- Code to View/Hide Status Bar in SDI and MDI Applications Roanoke VA
- Code to View/Hide Status Bar in SDI and MDI Applications Salem VA
- Code to View/Hide Status Bar in SDI and MDI Applications Spotsylvania VA
- Code to View/Hide Status Bar in SDI and MDI Applications Springfield VA
- Code to View/Hide Status Bar in SDI and MDI Applications Stafford VA
- Code to View/Hide Status Bar in SDI and MDI Applications Staunton VA
- Code to View/Hide Status Bar in SDI and MDI Applications Sterling VA
- Code to View/Hide Status Bar in SDI and MDI Applications Suffolk VA
- Code to View/Hide Status Bar in SDI and MDI Applications Vienna VA
- Code to View/Hide Status Bar in SDI and MDI Applications Vinton VA
- Code to View/Hide Status Bar in SDI and MDI Applications Virginia Beach VA
- Code to View/Hide Status Bar in SDI and MDI Applications Warrenton VA
- Code to View/Hide Status Bar in SDI and MDI Applications Waynesboro VA
- Code to View/Hide Status Bar in SDI and MDI Applications Williamsburg VA
- Code to View/Hide Status Bar in SDI and MDI Applications Winchester VA
- Code to View/Hide Status Bar in SDI and MDI Applications Woodbridge VA
- Code to View/Hide Status Bar in SDI and MDI Applications Yorktown VA
Related Articles
- Advanced C++/CLI Virginia
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.
- Interacting with .NET WinForms, Part 1 Virginia
- Audio Mixer Control Classes Virginia
- Avoiding Boolean Overload Virginia
- JavaBean Proxies Virginia
- Placing Logo on the Top DockBar of the Frame Window Virginia
- Extending CPictureHolder for loading BMP, JPG, etc. Virginia
- Enumerate NT services Virginia
- ListBox with Grayed Out / Non-Selectable Items Virginia
- Visual Basic .NET Attributes Virginia
Related Local Events
SANS Virginia Beach 2009
Dates: 8/28/2009 - 9/4/2009
Location: Sheraton Oceanfront Virginia Beach
Virginia Beach, VA
View Details

The 2009 Federal Technology Policy Forum
Dates: 7/15/2009 - 7/17/2009
Location: The Performance Institute
Arlington, VA
View Details

4th Annual Military Armor Protection
Dates: 6/23/2009 - 6/26/2009
Location: Hilton McLean
Tysons Corner, VA
View Details

Coalition Warfighter Interoperability Demonstration
Dates: 6/15/2009 - 6/26/2009
Location: Joint Systems Integration Center
Suffolk, VA
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