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

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

Softweb Solutions
866-345-7638
5707 Breezeland Road
Chicago, IL
STL Technology Partners
(309) 699-6389
630 High Point Lane
East Peoria, IL
DMi Technology Group
(309) 828-4439
406 Kays Drive
Normal, IL
InterraIT
(630) 873-3525
Two Mid America Plaza
Oakbrook Terrace, IL
StrategicSytems International
+1.847.424.2497
820 Davis Street,
Evanston, IL
Quantum Design (Quantum Software Solutions)
815-885-1300
8400 E. Riverside Blvd
Rockford, IL
IT360, Inc.
(309) 283-2915
311 SW Water Street
Peoria, IL
Stellar Systems, Inc
(309) 677-7350
222 NE Monroe St. #902
Peoria, IL
Stellar Systems, Inc.
(309) 677-7350
222 NE Monroe St. #902
Peoria, IL
IFS
888-437-4968
300 Park Boulevard, Suite 555
Itasca, IL

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

Softweb Solutions

IT Consultant Company offers custom software development services, Flex, ROR, Web application development services

866-345-7638
5707 Breezeland Road
Chicago, IL
http://www.SoftwebSolutions.com

Softweb Solutions is a prominent name in providing exclusive software development services for SMEs, specializing in custom application development, website development, system integration and software testing and quality assurance, with industry-specific software expertise in High-Technology, Software, Automotive, Financial Services and Entertainment sectors.

Custom Software Development and IT Consultant

Related Articles
- Visual Basic .NET Attributes Illinois
Attributes are classes that allow individual developers to extend VS.NET tools without rebuilding VS.NET each time. Many attributes are already available, but most of the interesting ones haven't even been written yet. Perhaps you will do so.
- JavaBean Proxies Illinois
- Interacting with .NET WinForms, Part 1 Illinois
- Placing Logo on the Top DockBar of the Frame Window Illinois
- ListBox with Grayed Out / Non-Selectable Items Illinois
- Enumerate NT services Illinois
- Avoiding Boolean Overload Illinois
- Audio Mixer Control Classes Illinois
- Extending CPictureHolder for loading BMP, JPG, etc. Illinois
- Advanced C++/CLI Illinois
Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Addison IL
- Code to View/Hide Status Bar in SDI and MDI Applications Algonquin IL
- Code to View/Hide Status Bar in SDI and MDI Applications Alsip IL
- Code to View/Hide Status Bar in SDI and MDI Applications Alton IL
- Code to View/Hide Status Bar in SDI and MDI Applications Arlington Heights IL
- Code to View/Hide Status Bar in SDI and MDI Applications Aurora IL
- Code to View/Hide Status Bar in SDI and MDI Applications Barrington IL
- Code to View/Hide Status Bar in SDI and MDI Applications Bartlett IL
- Code to View/Hide Status Bar in SDI and MDI Applications Batavia IL
- Code to View/Hide Status Bar in SDI and MDI Applications Belleville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Bellwood IL
- Code to View/Hide Status Bar in SDI and MDI Applications Belvidere IL
- Code to View/Hide Status Bar in SDI and MDI Applications Bensenville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Berwyn IL
- Code to View/Hide Status Bar in SDI and MDI Applications Bloomingdale IL
- Code to View/Hide Status Bar in SDI and MDI Applications Bloomington IL
- Code to View/Hide Status Bar in SDI and MDI Applications Blue Island IL
- Code to View/Hide Status Bar in SDI and MDI Applications Bolingbrook IL
- Code to View/Hide Status Bar in SDI and MDI Applications Bourbonnais IL
- Code to View/Hide Status Bar in SDI and MDI Applications Bridgeview IL
- Code to View/Hide Status Bar in SDI and MDI Applications Buffalo Grove IL
- Code to View/Hide Status Bar in SDI and MDI Applications Calumet City IL
- Code to View/Hide Status Bar in SDI and MDI Applications Carbondale IL
- Code to View/Hide Status Bar in SDI and MDI Applications Carol Stream IL
- Code to View/Hide Status Bar in SDI and MDI Applications Carpentersville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Champaign IL
- Code to View/Hide Status Bar in SDI and MDI Applications Chicago Heights IL
- Code to View/Hide Status Bar in SDI and MDI Applications Chicago IL
- Code to View/Hide Status Bar in SDI and MDI Applications Cicero IL
- Code to View/Hide Status Bar in SDI and MDI Applications Clarendon Hills IL
- Code to View/Hide Status Bar in SDI and MDI Applications Collinsville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Country Club Hills IL
- Code to View/Hide Status Bar in SDI and MDI Applications Crete IL
- Code to View/Hide Status Bar in SDI and MDI Applications Crystal Lake IL
- Code to View/Hide Status Bar in SDI and MDI Applications Danville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Decatur IL
- Code to View/Hide Status Bar in SDI and MDI Applications Deerfield IL
- Code to View/Hide Status Bar in SDI and MDI Applications Dekalb IL
- Code to View/Hide Status Bar in SDI and MDI Applications Des Plaines IL
- Code to View/Hide Status Bar in SDI and MDI Applications Dolton IL
- Code to View/Hide Status Bar in SDI and MDI Applications Downers Grove IL
- Code to View/Hide Status Bar in SDI and MDI Applications East Moline IL
- Code to View/Hide Status Bar in SDI and MDI Applications East Peoria IL
- Code to View/Hide Status Bar in SDI and MDI Applications East Saint Louis IL
- Code to View/Hide Status Bar in SDI and MDI Applications Edwardsville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Effingham IL
- Code to View/Hide Status Bar in SDI and MDI Applications Elgin IL
- Code to View/Hide Status Bar in SDI and MDI Applications Elk Grove Village IL
- Code to View/Hide Status Bar in SDI and MDI Applications Elmhurst IL
- Code to View/Hide Status Bar in SDI and MDI Applications Elmwood Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Evanston IL
- Code to View/Hide Status Bar in SDI and MDI Applications Evergreen Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Fairview Heights IL
- Code to View/Hide Status Bar in SDI and MDI Applications Franklin Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Freeport IL
- Code to View/Hide Status Bar in SDI and MDI Applications Galesburg IL
- Code to View/Hide Status Bar in SDI and MDI Applications Glen Ellyn IL
- Code to View/Hide Status Bar in SDI and MDI Applications Glendale Heights IL
- Code to View/Hide Status Bar in SDI and MDI Applications Glenview IL
- Code to View/Hide Status Bar in SDI and MDI Applications Godfrey IL
- Code to View/Hide Status Bar in SDI and MDI Applications Granite City IL
- Code to View/Hide Status Bar in SDI and MDI Applications Grayslake IL
- Code to View/Hide Status Bar in SDI and MDI Applications Gurnee IL
- Code to View/Hide Status Bar in SDI and MDI Applications Harvey IL
- Code to View/Hide Status Bar in SDI and MDI Applications Harwood Heights IL
- Code to View/Hide Status Bar in SDI and MDI Applications Hazel Crest IL
- Code to View/Hide Status Bar in SDI and MDI Applications Highland Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Hinsdale IL
- Code to View/Hide Status Bar in SDI and MDI Applications Homewood IL
- Code to View/Hide Status Bar in SDI and MDI Applications Jacksonville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Joliet IL
- Code to View/Hide Status Bar in SDI and MDI Applications Kankakee IL
- Code to View/Hide Status Bar in SDI and MDI Applications Kewanee IL
- Code to View/Hide Status Bar in SDI and MDI Applications La Grange IL
- Code to View/Hide Status Bar in SDI and MDI Applications Lake Bluff IL
- Code to View/Hide Status Bar in SDI and MDI Applications Lake Villa IL
- Code to View/Hide Status Bar in SDI and MDI Applications Lake Zurich IL
- Code to View/Hide Status Bar in SDI and MDI Applications Lansing IL
- Code to View/Hide Status Bar in SDI and MDI Applications Lemont IL
- Code to View/Hide Status Bar in SDI and MDI Applications Libertyville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Lisle IL
- Code to View/Hide Status Bar in SDI and MDI Applications Lockport IL
- Code to View/Hide Status Bar in SDI and MDI Applications Lombard IL
- Code to View/Hide Status Bar in SDI and MDI Applications Loves Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Machesney Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Matteson IL
- Code to View/Hide Status Bar in SDI and MDI Applications Mattoon IL
- Code to View/Hide Status Bar in SDI and MDI Applications Maywood IL
- Code to View/Hide Status Bar in SDI and MDI Applications Mchenry IL
- Code to View/Hide Status Bar in SDI and MDI Applications Melrose Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Midlothian IL
- Code to View/Hide Status Bar in SDI and MDI Applications Mokena IL
- Code to View/Hide Status Bar in SDI and MDI Applications Moline IL
- Code to View/Hide Status Bar in SDI and MDI Applications Morris IL
- Code to View/Hide Status Bar in SDI and MDI Applications Morton Grove IL
- Code to View/Hide Status Bar in SDI and MDI Applications Morton IL
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Prospect IL
- Code to View/Hide Status Bar in SDI and MDI Applications Mundelein IL
- Code to View/Hide Status Bar in SDI and MDI Applications Murphysboro IL
- Code to View/Hide Status Bar in SDI and MDI Applications Naperville IL
- Code to View/Hide Status Bar in SDI and MDI Applications New Lenox IL
- Code to View/Hide Status Bar in SDI and MDI Applications Niles IL
- Code to View/Hide Status Bar in SDI and MDI Applications Normal IL
- Code to View/Hide Status Bar in SDI and MDI Applications North Chicago IL
- Code to View/Hide Status Bar in SDI and MDI Applications Northbrook IL
- Code to View/Hide Status Bar in SDI and MDI Applications O Fallon IL
- Code to View/Hide Status Bar in SDI and MDI Applications Oak Forest IL
- Code to View/Hide Status Bar in SDI and MDI Applications Oak Lawn IL
- Code to View/Hide Status Bar in SDI and MDI Applications Oak Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Orland Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Palatine IL
- Code to View/Hide Status Bar in SDI and MDI Applications Palos Hills IL
- Code to View/Hide Status Bar in SDI and MDI Applications Park Forest IL
- Code to View/Hide Status Bar in SDI and MDI Applications Park Ridge IL
- Code to View/Hide Status Bar in SDI and MDI Applications Pekin IL
- Code to View/Hide Status Bar in SDI and MDI Applications Peoria IL
- Code to View/Hide Status Bar in SDI and MDI Applications Plainfield IL
- Code to View/Hide Status Bar in SDI and MDI Applications Prospect Heights IL
- Code to View/Hide Status Bar in SDI and MDI Applications Quincy IL
- Code to View/Hide Status Bar in SDI and MDI Applications Riverdale IL
- Code to View/Hide Status Bar in SDI and MDI Applications Rochelle IL
- Code to View/Hide Status Bar in SDI and MDI Applications Rock Falls IL
- Code to View/Hide Status Bar in SDI and MDI Applications Rock Island IL
- Code to View/Hide Status Bar in SDI and MDI Applications Rockford IL
- Code to View/Hide Status Bar in SDI and MDI Applications Rolling Meadows IL
- Code to View/Hide Status Bar in SDI and MDI Applications Romeoville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Roscoe IL
- Code to View/Hide Status Bar in SDI and MDI Applications Roselle IL
- Code to View/Hide Status Bar in SDI and MDI Applications Round Lake IL
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Charles IL
- Code to View/Hide Status Bar in SDI and MDI Applications Schaumburg IL
- Code to View/Hide Status Bar in SDI and MDI Applications Skokie IL
- Code to View/Hide Status Bar in SDI and MDI Applications South Elgin IL
- Code to View/Hide Status Bar in SDI and MDI Applications South Holland IL
- Code to View/Hide Status Bar in SDI and MDI Applications Springfield IL
- Code to View/Hide Status Bar in SDI and MDI Applications Streamwood IL
- Code to View/Hide Status Bar in SDI and MDI Applications Streator IL
- Code to View/Hide Status Bar in SDI and MDI Applications Sycamore IL
- Code to View/Hide Status Bar in SDI and MDI Applications Taylorville IL
- Code to View/Hide Status Bar in SDI and MDI Applications Tinley Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Urbana IL
- Code to View/Hide Status Bar in SDI and MDI Applications Vernon Hills IL
- Code to View/Hide Status Bar in SDI and MDI Applications Villa Park IL
- Code to View/Hide Status Bar in SDI and MDI Applications Waukegan IL
- Code to View/Hide Status Bar in SDI and MDI Applications West Chicago IL
- Code to View/Hide Status Bar in SDI and MDI Applications Westchester IL
- Code to View/Hide Status Bar in SDI and MDI Applications Westmont IL
- Code to View/Hide Status Bar in SDI and MDI Applications Wheaton IL
- Code to View/Hide Status Bar in SDI and MDI Applications Wheeling IL
- Code to View/Hide Status Bar in SDI and MDI Applications Wilmette IL
- Code to View/Hide Status Bar in SDI and MDI Applications Wood Dale IL
- Code to View/Hide Status Bar in SDI and MDI Applications Woodridge IL
- Code to View/Hide Status Bar in SDI and MDI Applications Woodstock IL
- Code to View/Hide Status Bar in SDI and MDI Applications Zion IL
Related Local Events
Virtualization / Consolidation Strategies - Implementation Strategies
Dates: 12/10/2009 - 12/10/2009
Location: The Donald E. Stephens Convention Center
Rosemont, IL
View Details

BIO - International Convention and Exhibition for Biotechnology
Dates: 5/2/2010 - 5/5/2010
Location: McCormick Place
Chicago, IL
View Details

PTXi - Process Technology Expo International
Dates: 5/4/2010 - 5/6/2010
Location: Donald E. Stephens Convention Center
Rosemont, IL
View Details

The CIO Agenda - 2010 and Beyond
Dates: 11/5/2009 - 11/5/2009
Location: The Donald E. Stephens Convention Center
Rosemont, IL
View Details

SuperComm
Dates: 10/21/2009 - 10/23/2009
Location: McCormick Place, Chicago
Chicago, IL
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