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

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

Punch Software LLC
816-891-0025
7900 NW 100th St
Kansas City, MO
Trabon Solutions
816-926-9800
420 E Bannister RD
Kansas City, MO
Drafix Software
816-842-4955
114 W 3rd St
Kansas City, MO
Client Server Solutions Inc
314-523-4400
2008 Altom CT
St. Louis, MO
Open Software Technology
314-854-9138
7777 Bonhomme Ave
St. Louis, MO
Quest Software Inc
314-523-4400
2008 Altom CT
St. Louis, MO
Wonderware Central
888-676-9933
Two City Place Drive
St. Louis, MO
STL EHR Group
314-477-7459
689 Craig Road
Creve Coeur, MO
Amgraf Inc
816-474-4797
1501 Oak St
Kansas City, MO
Digital Consulting & Software
314-682-2350
12655 Olive Blvd
St. Louis, MO

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

Punch Software LLC

816-891-0025
7900 NW 100th St
Kansas City, MO

Related Articles
- Advanced C++/CLI Missouri
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.
- JavaBean Proxies Missouri
- ListBox with Grayed Out / Non-Selectable Items Missouri
- Extending CPictureHolder for loading BMP, JPG, etc. Missouri
- Visual Basic .NET Attributes Missouri
- Interacting with .NET WinForms, Part 1 Missouri
- Enumerate NT services Missouri
- Placing Logo on the Top DockBar of the Frame Window Missouri
- Avoiding Boolean Overload Missouri
- Audio Mixer Control Classes Missouri
Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Arnold MO
- Code to View/Hide Status Bar in SDI and MDI Applications Ballwin MO
- Code to View/Hide Status Bar in SDI and MDI Applications Belton MO
- Code to View/Hide Status Bar in SDI and MDI Applications Blue Springs MO
- Code to View/Hide Status Bar in SDI and MDI Applications Bolivar MO
- Code to View/Hide Status Bar in SDI and MDI Applications Branson MO
- Code to View/Hide Status Bar in SDI and MDI Applications Cape Girardeau MO
- Code to View/Hide Status Bar in SDI and MDI Applications Chesterfield MO
- Code to View/Hide Status Bar in SDI and MDI Applications Columbia MO
- Code to View/Hide Status Bar in SDI and MDI Applications De Soto MO
- Code to View/Hide Status Bar in SDI and MDI Applications Excelsior Springs MO
- Code to View/Hide Status Bar in SDI and MDI Applications Fenton MO
- Code to View/Hide Status Bar in SDI and MDI Applications Festus MO
- Code to View/Hide Status Bar in SDI and MDI Applications Florissant MO
- Code to View/Hide Status Bar in SDI and MDI Applications Grandview MO
- Code to View/Hide Status Bar in SDI and MDI Applications Hannibal MO
- Code to View/Hide Status Bar in SDI and MDI Applications Hazelwood MO
- Code to View/Hide Status Bar in SDI and MDI Applications Independence MO
- Code to View/Hide Status Bar in SDI and MDI Applications Jefferson City MO
- Code to View/Hide Status Bar in SDI and MDI Applications Joplin MO
- Code to View/Hide Status Bar in SDI and MDI Applications Kansas City MO
- Code to View/Hide Status Bar in SDI and MDI Applications Kirksville MO
- Code to View/Hide Status Bar in SDI and MDI Applications Lebanon MO
- Code to View/Hide Status Bar in SDI and MDI Applications Lees Summit MO
- Code to View/Hide Status Bar in SDI and MDI Applications Liberty MO
- Code to View/Hide Status Bar in SDI and MDI Applications Maryland Heights MO
- Code to View/Hide Status Bar in SDI and MDI Applications Moberly MO
- Code to View/Hide Status Bar in SDI and MDI Applications Neosho MO
- Code to View/Hide Status Bar in SDI and MDI Applications Nixa MO
- Code to View/Hide Status Bar in SDI and MDI Applications O Fallon MO
- Code to View/Hide Status Bar in SDI and MDI Applications Pacific MO
- Code to View/Hide Status Bar in SDI and MDI Applications Park Hills MO
- Code to View/Hide Status Bar in SDI and MDI Applications Perryville MO
- Code to View/Hide Status Bar in SDI and MDI Applications Poplar Bluff MO
- Code to View/Hide Status Bar in SDI and MDI Applications Rolla MO
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Ann MO
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Charles MO
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Joseph MO
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Louis MO
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Peters MO
- Code to View/Hide Status Bar in SDI and MDI Applications Sedalia MO
- Code to View/Hide Status Bar in SDI and MDI Applications Sikeston MO
- Code to View/Hide Status Bar in SDI and MDI Applications Springfield MO
- Code to View/Hide Status Bar in SDI and MDI Applications Warrensburg MO
- Code to View/Hide Status Bar in SDI and MDI Applications West Plains MO
Related Articles
- Advanced C++/CLI Missouri
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.
- JavaBean Proxies Missouri
- ListBox with Grayed Out / Non-Selectable Items Missouri
- Extending CPictureHolder for loading BMP, JPG, etc. Missouri
- Visual Basic .NET Attributes Missouri
- Interacting with .NET WinForms, Part 1 Missouri
- Enumerate NT services Missouri
- Placing Logo on the Top DockBar of the Frame Window Missouri
- Avoiding Boolean Overload Missouri
- Audio Mixer Control Classes Missouri
Related Local Events
Ozarks Technical Community College Center for Workforce Development: IT Consortium Planning Meeting
Dates: 12/3/2009 - 12/3/2009
Location: Springfield Area Chamber of Commerce
Springfield, MO
View Details

60 Minutes to Success: WWW: Who, What and Where do I turn to for my IT needs
Dates: 10/7/2009 - 10/7/2009
Location: Springfield Area Chamber of Commerce
Springfield, MO
View Details

Girls in Science, Technology, Engineering and Mathematics: Exploring Opportunities and Opening Doors
Dates: 10/6/2009 - 10/6/2009
Location: Metropolitan Community College
Kansas City, MO
View Details

BarCampKC
Dates: 9/26/2009 - 9/26/2009
Location: JavaportKC
Kansas City, MO
View Details

Brain Food-Discover the 21st Century Virtual Office
Dates: 9/16/2009 - 9/16/2009
Location: World Trade Center Room
Kansas City, MO
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