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

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

Charlotte Web Design & Development
(704) 577-8242
Commodore point rd
Lake Wylie, SC
Pinnacle Consulting LLC
803 629 5243
98 Groves Wood Ct
Columbia, SC
Coastal Technology Group/CTG Consulting
(704) 609-4091
4522 Firethorne Drive
Murrells Inlet, SC
Progressive Systems
(864) 941-8970
1612 Rivers St
Greenwood, SC
Woodside & Associates
(803) 790-1717
25 Cedarwood Ln
Columbia, SC
Metalogix
(803) 548-9390
1061 521 Corporate Ctr Dr Ste 155
Fort Mill, SC
My Tech Services Inc
(803) 359-1571
Lexington, SC
Paris Mountain Consulting
(864) 232-6011
833 Altamont Rd
Greenville, SC
T R C Computers & Software
(843) 821-4242
121 Stratford Dr
Summerville, SC
Keystone Computer Corp Inc
(864) 627-9244
1200 Woodruff Rd Ste B10
Greenville, SC

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

Charlotte Web Design & Development

7045778242
Commodore point rd
Lake Wylie, SC
http://www.charlottewebdevelopment.com

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Aiken SC
- Code to View/Hide Status Bar in SDI and MDI Applications Anderson SC
- Code to View/Hide Status Bar in SDI and MDI Applications Beaufort SC
- Code to View/Hide Status Bar in SDI and MDI Applications Bennettsville SC
- Code to View/Hide Status Bar in SDI and MDI Applications Bluffton SC
- Code to View/Hide Status Bar in SDI and MDI Applications Boiling Springs SC
- Code to View/Hide Status Bar in SDI and MDI Applications Charleston SC
- Code to View/Hide Status Bar in SDI and MDI Applications Clemson SC
- Code to View/Hide Status Bar in SDI and MDI Applications Clover SC
- Code to View/Hide Status Bar in SDI and MDI Applications Columbia SC
- Code to View/Hide Status Bar in SDI and MDI Applications Conway SC
- Code to View/Hide Status Bar in SDI and MDI Applications Darlington SC
- Code to View/Hide Status Bar in SDI and MDI Applications Dillon SC
- Code to View/Hide Status Bar in SDI and MDI Applications Easley SC
- Code to View/Hide Status Bar in SDI and MDI Applications Florence SC
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Mill SC
- Code to View/Hide Status Bar in SDI and MDI Applications Fountain Inn SC
- Code to View/Hide Status Bar in SDI and MDI Applications Gaffney SC
- Code to View/Hide Status Bar in SDI and MDI Applications Gaston SC
- Code to View/Hide Status Bar in SDI and MDI Applications Georgetown SC
- Code to View/Hide Status Bar in SDI and MDI Applications Goose Creek SC
- Code to View/Hide Status Bar in SDI and MDI Applications Greenville SC
- Code to View/Hide Status Bar in SDI and MDI Applications Greenwood SC
- Code to View/Hide Status Bar in SDI and MDI Applications Greer SC
- Code to View/Hide Status Bar in SDI and MDI Applications Hartsville SC
- Code to View/Hide Status Bar in SDI and MDI Applications Hilton Head Island SC
- Code to View/Hide Status Bar in SDI and MDI Applications Inman SC
- Code to View/Hide Status Bar in SDI and MDI Applications Irmo SC
- Code to View/Hide Status Bar in SDI and MDI Applications Ladson SC
- Code to View/Hide Status Bar in SDI and MDI Applications Lancaster SC
- Code to View/Hide Status Bar in SDI and MDI Applications Laurens SC
- Code to View/Hide Status Bar in SDI and MDI Applications Lexington SC
- Code to View/Hide Status Bar in SDI and MDI Applications Manning SC
- Code to View/Hide Status Bar in SDI and MDI Applications Moncks Corner SC
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Pleasant SC
- Code to View/Hide Status Bar in SDI and MDI Applications Murrells Inlet SC
- Code to View/Hide Status Bar in SDI and MDI Applications Myrtle Beach SC
- Code to View/Hide Status Bar in SDI and MDI Applications Newberry SC
- Code to View/Hide Status Bar in SDI and MDI Applications North Augusta SC
- Code to View/Hide Status Bar in SDI and MDI Applications North Charleston SC
- Code to View/Hide Status Bar in SDI and MDI Applications Orangeburg SC
- Code to View/Hide Status Bar in SDI and MDI Applications Pickens SC
- Code to View/Hide Status Bar in SDI and MDI Applications Piedmont SC
- Code to View/Hide Status Bar in SDI and MDI Applications Rock Hill SC
- Code to View/Hide Status Bar in SDI and MDI Applications Seneca SC
- Code to View/Hide Status Bar in SDI and MDI Applications Simpsonville SC
- Code to View/Hide Status Bar in SDI and MDI Applications Spartanburg SC
- Code to View/Hide Status Bar in SDI and MDI Applications Summerville SC
- Code to View/Hide Status Bar in SDI and MDI Applications Sumter SC
- Code to View/Hide Status Bar in SDI and MDI Applications Taylors SC
- Code to View/Hide Status Bar in SDI and MDI Applications Travelers Rest SC
- Code to View/Hide Status Bar in SDI and MDI Applications Walterboro SC
- Code to View/Hide Status Bar in SDI and MDI Applications West Columbia SC
Related Local Event
Information Technology Council
Dates: 11/10/2009 - 11/10/2009
Location: Greater Columbia Chamber of Commerce
Columbia, SC
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