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

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

Media Lantern Inc,
(800) 705-1213
236 State Street
New London, CT
Nandvarik Systems
999-999-9999
Farmington
Hartford, CT
Microsoft
(860) 916-7448
74 Batterson Park Rd., Ste. 100
Farmington, CT
OFFiS Corporation
203-265-6700
61 N Plains Industrial Rd
Wallingford, CT
Tamion Company
800-582-9637
1178 Mill Street
East Berlin, CT
GoECart
203 336 2284
Park City Plaza, 10 Middle Street
Bridgeport, CT
Coordinated Systems, Inc.
860-289-2151
165 Burnside Avenue
East Hartford, CT
Software Technology Inc
(860) 528-6400
914 Main St
East Hartford, CT
Enright & Nadeau Associates Llc
(203) 267-1156
800 Main St S
Southbury, CT
Integrated Business Information Systems
(203) 397-1523
22 Colonial Pl
New Haven, CT

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

Media Lantern Inc,

(800) 705-1213
236 State Street
New London, CT

Related Articles
- Advanced C++/CLI Connecticut
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.
- Extending CPictureHolder for loading BMP, JPG, etc. Connecticut
- Visual Basic .NET Attributes Connecticut
- JavaBean Proxies Connecticut
- Interacting with .NET WinForms, Part 1 Connecticut
- Audio Mixer Control Classes Connecticut
- Enumerate NT services Connecticut
- Avoiding Boolean Overload Connecticut
- ListBox with Grayed Out / Non-Selectable Items Connecticut
- Placing Logo on the Top DockBar of the Frame Window Connecticut
Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Ansonia CT
- Code to View/Hide Status Bar in SDI and MDI Applications Bethel CT
- Code to View/Hide Status Bar in SDI and MDI Applications Branford CT
- Code to View/Hide Status Bar in SDI and MDI Applications Bridgeport CT
- Code to View/Hide Status Bar in SDI and MDI Applications Bristol CT
- Code to View/Hide Status Bar in SDI and MDI Applications Cheshire CT
- Code to View/Hide Status Bar in SDI and MDI Applications Danbury CT
- Code to View/Hide Status Bar in SDI and MDI Applications East Hartford CT
- Code to View/Hide Status Bar in SDI and MDI Applications East Haven CT
- Code to View/Hide Status Bar in SDI and MDI Applications Enfield CT
- Code to View/Hide Status Bar in SDI and MDI Applications Glastonbury CT
- Code to View/Hide Status Bar in SDI and MDI Applications Greenwich CT
- Code to View/Hide Status Bar in SDI and MDI Applications Groton CT
- Code to View/Hide Status Bar in SDI and MDI Applications Guilford CT
- Code to View/Hide Status Bar in SDI and MDI Applications Hamden CT
- Code to View/Hide Status Bar in SDI and MDI Applications Hartford CT
- Code to View/Hide Status Bar in SDI and MDI Applications Manchester CT
- Code to View/Hide Status Bar in SDI and MDI Applications Meriden CT
- Code to View/Hide Status Bar in SDI and MDI Applications Middletown CT
- Code to View/Hide Status Bar in SDI and MDI Applications Milford CT
- Code to View/Hide Status Bar in SDI and MDI Applications Naugatuck CT
- Code to View/Hide Status Bar in SDI and MDI Applications New Britain CT
- Code to View/Hide Status Bar in SDI and MDI Applications New Canaan CT
- Code to View/Hide Status Bar in SDI and MDI Applications New Haven CT
- Code to View/Hide Status Bar in SDI and MDI Applications New London CT
- Code to View/Hide Status Bar in SDI and MDI Applications Newington CT
- Code to View/Hide Status Bar in SDI and MDI Applications North Haven CT
- Code to View/Hide Status Bar in SDI and MDI Applications Norwalk CT
- Code to View/Hide Status Bar in SDI and MDI Applications Norwich CT
- Code to View/Hide Status Bar in SDI and MDI Applications Plainville CT
- Code to View/Hide Status Bar in SDI and MDI Applications Ridgefield CT
- Code to View/Hide Status Bar in SDI and MDI Applications Rocky Hill CT
- Code to View/Hide Status Bar in SDI and MDI Applications Shelton CT
- Code to View/Hide Status Bar in SDI and MDI Applications Simsbury CT
- Code to View/Hide Status Bar in SDI and MDI Applications South Windsor CT
- Code to View/Hide Status Bar in SDI and MDI Applications Southbury CT
- Code to View/Hide Status Bar in SDI and MDI Applications Southington CT
- Code to View/Hide Status Bar in SDI and MDI Applications Stamford CT
- Code to View/Hide Status Bar in SDI and MDI Applications Storrs Mansfield CT
- Code to View/Hide Status Bar in SDI and MDI Applications Stratford CT
- Code to View/Hide Status Bar in SDI and MDI Applications Torrington CT
- Code to View/Hide Status Bar in SDI and MDI Applications Trumbull CT
- Code to View/Hide Status Bar in SDI and MDI Applications Vernon Rockville CT
- Code to View/Hide Status Bar in SDI and MDI Applications Wallingford CT
- Code to View/Hide Status Bar in SDI and MDI Applications Waterbury CT
- Code to View/Hide Status Bar in SDI and MDI Applications West Hartford CT
- Code to View/Hide Status Bar in SDI and MDI Applications West Haven CT
- Code to View/Hide Status Bar in SDI and MDI Applications Westport CT
- Code to View/Hide Status Bar in SDI and MDI Applications Wethersfield CT
- Code to View/Hide Status Bar in SDI and MDI Applications Willimantic CT
- Code to View/Hide Status Bar in SDI and MDI Applications Wilton CT
- Code to View/Hide Status Bar in SDI and MDI Applications Windsor CT
- Code to View/Hide Status Bar in SDI and MDI Applications Winsted CT
- Code to View/Hide Status Bar in SDI and MDI Applications Wolcott CT
Related Articles
- Advanced C++/CLI Connecticut
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.
- Extending CPictureHolder for loading BMP, JPG, etc. Connecticut
- Visual Basic .NET Attributes Connecticut
- JavaBean Proxies Connecticut
- Interacting with .NET WinForms, Part 1 Connecticut
- Audio Mixer Control Classes Connecticut
- Enumerate NT services Connecticut
- Avoiding Boolean Overload Connecticut
- ListBox with Grayed Out / Non-Selectable Items Connecticut
- Placing Logo on the Top DockBar of the Frame Window Connecticut
Related Local Events
The New Balancing Act
Dates: 11/5/2009 - 11/5/2009
Location: Acton Public Library
Old Saybrook, CT
View Details

The New Balancing Act
Dates: 11/3/2009 - 11/3/2009
Location: Estuary Council of Seniors
Old Saybrook, CT
View Details

Discover SW Technology sub-committee
Dates: 8/20/2009 - 8/20/2009
Location: South Windsor Chamber of Commerce
South Windsor, CT
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