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

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

Driver Technology Consulting, LLC
601 316-1692
445 Greenmont Drive
Jackson, MS
i.t.works
(601) 264-0969
6641 hwy 98 west
hattiesburg, MS
H P N Consulting Group Llc
(601) 957-8386
875 Northpark Dr
Ridgeland, MS
Micro-Sped
(662) 455-1967
400 E Washington St
Greenwood, MS
H Pn Consulting Group
(601) 957-3470
875 Northpark Dr
Jackson, MS
Scruggs & Associates
(601) 426-3419
542 Central Ave
Laurel, MS
Premise Inc
(601) 579-9475
7 Woodstone Plz Ste 6
Hattiesburg, MS
Cisco Systems
(601) 957-5132
Jackson, MS
Integrated Concepts and Research Corp
(601) 636-6616
3516 Manor Dr
Vicksburg, MS
World Class Computers & Associates
(601) 376-0910
Jackson, MS

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

Driver Technology Consulting, LLC

601 316-1692
445 Greenmont Drive
Jackson, MS
www.dtc-ms.com

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Bay Saint Louis MS
- Code to View/Hide Status Bar in SDI and MDI Applications Biloxi MS
- Code to View/Hide Status Bar in SDI and MDI Applications Booneville MS
- Code to View/Hide Status Bar in SDI and MDI Applications Brandon MS
- Code to View/Hide Status Bar in SDI and MDI Applications Byhalia MS
- Code to View/Hide Status Bar in SDI and MDI Applications Clarksdale MS
- Code to View/Hide Status Bar in SDI and MDI Applications Clinton MS
- Code to View/Hide Status Bar in SDI and MDI Applications Columbus MS
- Code to View/Hide Status Bar in SDI and MDI Applications Corinth MS
- Code to View/Hide Status Bar in SDI and MDI Applications Gautier MS
- Code to View/Hide Status Bar in SDI and MDI Applications Greenville MS
- Code to View/Hide Status Bar in SDI and MDI Applications Greenwood MS
- Code to View/Hide Status Bar in SDI and MDI Applications Grenada MS
- Code to View/Hide Status Bar in SDI and MDI Applications Gulfport MS
- Code to View/Hide Status Bar in SDI and MDI Applications Hattiesburg MS
- Code to View/Hide Status Bar in SDI and MDI Applications Hernando MS
- Code to View/Hide Status Bar in SDI and MDI Applications Holly Springs MS
- Code to View/Hide Status Bar in SDI and MDI Applications Horn Lake MS
- Code to View/Hide Status Bar in SDI and MDI Applications Jackson MS
- Code to View/Hide Status Bar in SDI and MDI Applications Laurel MS
- Code to View/Hide Status Bar in SDI and MDI Applications Lucedale MS
- Code to View/Hide Status Bar in SDI and MDI Applications Mccomb MS
- Code to View/Hide Status Bar in SDI and MDI Applications Meridian MS
- Code to View/Hide Status Bar in SDI and MDI Applications Moss Point MS
- Code to View/Hide Status Bar in SDI and MDI Applications Natchez MS
- Code to View/Hide Status Bar in SDI and MDI Applications Ocean Springs MS
- Code to View/Hide Status Bar in SDI and MDI Applications Olive Branch MS
- Code to View/Hide Status Bar in SDI and MDI Applications Oxford MS
- Code to View/Hide Status Bar in SDI and MDI Applications Pascagoula MS
- Code to View/Hide Status Bar in SDI and MDI Applications Pass Christian MS
- Code to View/Hide Status Bar in SDI and MDI Applications Pearl MS
- Code to View/Hide Status Bar in SDI and MDI Applications Petal MS
- Code to View/Hide Status Bar in SDI and MDI Applications Picayune MS
- Code to View/Hide Status Bar in SDI and MDI Applications Pontotoc MS
- Code to View/Hide Status Bar in SDI and MDI Applications Ridgeland MS
- Code to View/Hide Status Bar in SDI and MDI Applications Southaven MS
- Code to View/Hide Status Bar in SDI and MDI Applications Starkville MS
- Code to View/Hide Status Bar in SDI and MDI Applications Tupelo MS
- Code to View/Hide Status Bar in SDI and MDI Applications Vicksburg MS
- Code to View/Hide Status Bar in SDI and MDI Applications West Point MS
- Code to View/Hide Status Bar in SDI and MDI Applications Yazoo City MS
Related Local Event
OCEANS 2009
Dates: 10/27/2009 - 10/29/2009
Location: Mississippi Coast Coliseum and Convention Center
Biloxi, MS
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