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

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

EMD Serono, Inc.
(781) 982-9000
1 Technology Place
Rockand, MA
Roxbury Technology Corporation
(617) 524-1020
3368 Washington Street
Jamaica Plain, MA
Edgewater Technology, Inc
(781) 246-3343
20 Harvard Mill Square
Wakefield, MA
Eze Castle Integration
(617) 217-3000
1 Federal Street, 9th Flr.
Boston, MA
CGI
(978) 946-3000
600 Federal Street
Andover, MA
JCALPRO
(617) 954-2345
415 Summer Street
Boston, MA
Bahwan CyberTek Inc.
(508) 652-0015
209 West Central Street, Ste. 312
Natick, MA
Cogent Communications
(617) 482-5546
1 Summer Street, Ste. 450
Boston, MA
Corda Technologies, Inc.
(978) 358-7388
11 Storeybrooke Drive
Newburyport, MA
KMT Software. Inc.
(617)4412855
50 Mount Vernon Street
Cambridge, MA

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

EMD Serono, Inc.

(781) 982-9000
1 Technology Place
Rockand, MA
http://www.emdserono.com/en/index.html

EMD Serono, Inc. is a leader in the biopharmaceutical arena, integrating cutting-edge science with unparalleled patient support systems to improve patient's lives. Focusing on specialized areas including neurodegenerative diseases, fertility, metabolic endocrinology, as well as oncology as an emerging area of expertise, EMD Serono is committed to discovering and developing innovative products that meet unmet medical needs

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Acton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Agawam MA
- Code to View/Hide Status Bar in SDI and MDI Applications Allston MA
- Code to View/Hide Status Bar in SDI and MDI Applications Amesbury MA
- Code to View/Hide Status Bar in SDI and MDI Applications Amherst MA
- Code to View/Hide Status Bar in SDI and MDI Applications Andover MA
- Code to View/Hide Status Bar in SDI and MDI Applications Arlington MA
- Code to View/Hide Status Bar in SDI and MDI Applications Attleboro MA
- Code to View/Hide Status Bar in SDI and MDI Applications Beverly MA
- Code to View/Hide Status Bar in SDI and MDI Applications Billerica MA
- Code to View/Hide Status Bar in SDI and MDI Applications Boston MA
- Code to View/Hide Status Bar in SDI and MDI Applications Braintree MA
- Code to View/Hide Status Bar in SDI and MDI Applications Bridgewater MA
- Code to View/Hide Status Bar in SDI and MDI Applications Brighton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Brockton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Brookline MA
- Code to View/Hide Status Bar in SDI and MDI Applications Buzzards Bay MA
- Code to View/Hide Status Bar in SDI and MDI Applications Cambridge MA
- Code to View/Hide Status Bar in SDI and MDI Applications Charlestown MA
- Code to View/Hide Status Bar in SDI and MDI Applications Chelmsford MA
- Code to View/Hide Status Bar in SDI and MDI Applications Chelsea MA
- Code to View/Hide Status Bar in SDI and MDI Applications Chicopee MA
- Code to View/Hide Status Bar in SDI and MDI Applications Danvers MA
- Code to View/Hide Status Bar in SDI and MDI Applications Dedham MA
- Code to View/Hide Status Bar in SDI and MDI Applications Dracut MA
- Code to View/Hide Status Bar in SDI and MDI Applications East Falmouth MA
- Code to View/Hide Status Bar in SDI and MDI Applications East Weymouth MA
- Code to View/Hide Status Bar in SDI and MDI Applications Easthampton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Everett MA
- Code to View/Hide Status Bar in SDI and MDI Applications Fairhaven MA
- Code to View/Hide Status Bar in SDI and MDI Applications Fall River MA
- Code to View/Hide Status Bar in SDI and MDI Applications Fitchburg MA
- Code to View/Hide Status Bar in SDI and MDI Applications Foxboro MA
- Code to View/Hide Status Bar in SDI and MDI Applications Framingham MA
- Code to View/Hide Status Bar in SDI and MDI Applications Franklin MA
- Code to View/Hide Status Bar in SDI and MDI Applications Gardner MA
- Code to View/Hide Status Bar in SDI and MDI Applications Gloucester MA
- Code to View/Hide Status Bar in SDI and MDI Applications Haverhill MA
- Code to View/Hide Status Bar in SDI and MDI Applications Hingham MA
- Code to View/Hide Status Bar in SDI and MDI Applications Holyoke MA
- Code to View/Hide Status Bar in SDI and MDI Applications Hyannis MA
- Code to View/Hide Status Bar in SDI and MDI Applications Hyde Park MA
- Code to View/Hide Status Bar in SDI and MDI Applications Jamaica Plain MA
- Code to View/Hide Status Bar in SDI and MDI Applications Lawrence MA
- Code to View/Hide Status Bar in SDI and MDI Applications Leominster MA
- Code to View/Hide Status Bar in SDI and MDI Applications Lexington MA
- Code to View/Hide Status Bar in SDI and MDI Applications Longmeadow MA
- Code to View/Hide Status Bar in SDI and MDI Applications Lowell MA
- Code to View/Hide Status Bar in SDI and MDI Applications Ludlow MA
- Code to View/Hide Status Bar in SDI and MDI Applications Lynn MA
- Code to View/Hide Status Bar in SDI and MDI Applications Malden MA
- Code to View/Hide Status Bar in SDI and MDI Applications Marblehead MA
- Code to View/Hide Status Bar in SDI and MDI Applications Marlborough MA
- Code to View/Hide Status Bar in SDI and MDI Applications Mattapan MA
- Code to View/Hide Status Bar in SDI and MDI Applications Medford MA
- Code to View/Hide Status Bar in SDI and MDI Applications Melrose MA
- Code to View/Hide Status Bar in SDI and MDI Applications Methuen MA
- Code to View/Hide Status Bar in SDI and MDI Applications Middleboro MA
- Code to View/Hide Status Bar in SDI and MDI Applications Milford MA
- Code to View/Hide Status Bar in SDI and MDI Applications Milton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Natick MA
- Code to View/Hide Status Bar in SDI and MDI Applications Needham MA
- Code to View/Hide Status Bar in SDI and MDI Applications New Bedford MA
- Code to View/Hide Status Bar in SDI and MDI Applications Newburyport MA
- Code to View/Hide Status Bar in SDI and MDI Applications Newton Center MA
- Code to View/Hide Status Bar in SDI and MDI Applications North Adams MA
- Code to View/Hide Status Bar in SDI and MDI Applications North Andover MA
- Code to View/Hide Status Bar in SDI and MDI Applications North Attleboro MA
- Code to View/Hide Status Bar in SDI and MDI Applications North Dartmouth MA
- Code to View/Hide Status Bar in SDI and MDI Applications Northampton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Norton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Norwood MA
- Code to View/Hide Status Bar in SDI and MDI Applications Peabody MA
- Code to View/Hide Status Bar in SDI and MDI Applications Pittsfield MA
- Code to View/Hide Status Bar in SDI and MDI Applications Plymouth MA
- Code to View/Hide Status Bar in SDI and MDI Applications Quincy MA
- Code to View/Hide Status Bar in SDI and MDI Applications Randolph MA
- Code to View/Hide Status Bar in SDI and MDI Applications Revere MA
- Code to View/Hide Status Bar in SDI and MDI Applications Roslindale MA
- Code to View/Hide Status Bar in SDI and MDI Applications Salem MA
- Code to View/Hide Status Bar in SDI and MDI Applications Saugus MA
- Code to View/Hide Status Bar in SDI and MDI Applications Scituate MA
- Code to View/Hide Status Bar in SDI and MDI Applications Shrewsbury MA
- Code to View/Hide Status Bar in SDI and MDI Applications Somerville MA
- Code to View/Hide Status Bar in SDI and MDI Applications South Hadley MA
- Code to View/Hide Status Bar in SDI and MDI Applications South Weymouth MA
- Code to View/Hide Status Bar in SDI and MDI Applications Southbridge MA
- Code to View/Hide Status Bar in SDI and MDI Applications Springfield MA
- Code to View/Hide Status Bar in SDI and MDI Applications Stoneham MA
- Code to View/Hide Status Bar in SDI and MDI Applications Stoughton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Swampscott MA
- Code to View/Hide Status Bar in SDI and MDI Applications Taunton MA
- Code to View/Hide Status Bar in SDI and MDI Applications Tewksbury MA
- Code to View/Hide Status Bar in SDI and MDI Applications Walpole MA
- Code to View/Hide Status Bar in SDI and MDI Applications Waltham MA
- Code to View/Hide Status Bar in SDI and MDI Applications Watertown MA
- Code to View/Hide Status Bar in SDI and MDI Applications West Roxbury MA
- Code to View/Hide Status Bar in SDI and MDI Applications West Springfield MA
- Code to View/Hide Status Bar in SDI and MDI Applications Westborough MA
- Code to View/Hide Status Bar in SDI and MDI Applications Westfield MA
- Code to View/Hide Status Bar in SDI and MDI Applications Westford MA
- Code to View/Hide Status Bar in SDI and MDI Applications Weymouth MA
- Code to View/Hide Status Bar in SDI and MDI Applications Winthrop MA
- Code to View/Hide Status Bar in SDI and MDI Applications Woburn MA
- Code to View/Hide Status Bar in SDI and MDI Applications Worcester MA
Related Local Events
Annual Lighting of the Pilgrim Monument
Dates: 11/23/2009 - 11/27/2009
Location: Pilgrim Monument High Pole Hill Road
Provincetown, MA
View Details

Annual Lighting of the Pilgrim Monument
Dates: 11/25/2009 - 11/25/2009
Location: Pilgrim Monument
Provincetown, MA
View Details

Software Development Best Practices 2009
Dates: 9/21/2009 - 9/24/2009
Location: Hynes Convention Center
Boston, MA
View Details

EMBEDDED SYSTEMS CONFERENCE - BOSTON 2009
Dates: 9/21/2009 - 9/24/2009
Location: Hynes Convention Center
Boston, MA
View Details

September Networking Breakfast
Dates: 9/15/2009 - 9/15/2009
Location: Holiday Inn Boston - Somerville
Somerville, MA
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