Code to View/Hide Status Bar in SDI and MDI Applications North 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

The Lead Tree
321-206-8283
306 North Rankin Street
Atkinson, NC
StreamLogic Inc.
704-771-1090
3030 Glen Summit Dr.
Charlotte, NC
D P Solutions Inc
336-854-7700
4411 W Market St
Greensboro, NC
Software Design Inc
336-378-0900
1301 Carolina St
Greensboro, NC
Advantec Information Systems LLC
336-275-2832
2007 Yanceyville St
Greensboro, NC
Community Web
336-499-3001
133 Hicks St
Winston-Salem, NC
BuildLinks: Web-based Project Management for Home Builders
888-700-9470
3800 Paramount Parkway, Suite 100
Morrisville, NC
Collabera
(704) 372-7272
212 South Tryon Street
Charlotte, NC
CompuData, Inc
(704) 504-0600
2401 Whitehall Park Drive
Charlotte, NC
Dalcom Consulting
336-851-1802
8 Oak Branch DR
Greensboro, NC

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

The Lead Tree

321-206-8283
306 North Rankin Street
Atkinson, NC

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Albemarle NC
- Code to View/Hide Status Bar in SDI and MDI Applications Apex NC
- Code to View/Hide Status Bar in SDI and MDI Applications Arden NC
- Code to View/Hide Status Bar in SDI and MDI Applications Asheboro NC
- Code to View/Hide Status Bar in SDI and MDI Applications Asheville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Bessemer City NC
- Code to View/Hide Status Bar in SDI and MDI Applications Boone NC
- Code to View/Hide Status Bar in SDI and MDI Applications Brevard NC
- Code to View/Hide Status Bar in SDI and MDI Applications Burlington NC
- Code to View/Hide Status Bar in SDI and MDI Applications Camp Lejeune NC
- Code to View/Hide Status Bar in SDI and MDI Applications Candler NC
- Code to View/Hide Status Bar in SDI and MDI Applications Cary NC
- Code to View/Hide Status Bar in SDI and MDI Applications Chapel Hill NC
- Code to View/Hide Status Bar in SDI and MDI Applications Charlotte NC
- Code to View/Hide Status Bar in SDI and MDI Applications Clayton NC
- Code to View/Hide Status Bar in SDI and MDI Applications Clemmons NC
- Code to View/Hide Status Bar in SDI and MDI Applications Clinton NC
- Code to View/Hide Status Bar in SDI and MDI Applications Concord NC
- Code to View/Hide Status Bar in SDI and MDI Applications Conover NC
- Code to View/Hide Status Bar in SDI and MDI Applications Dunn NC
- Code to View/Hide Status Bar in SDI and MDI Applications Durham NC
- Code to View/Hide Status Bar in SDI and MDI Applications Eden NC
- Code to View/Hide Status Bar in SDI and MDI Applications Elizabeth City NC
- Code to View/Hide Status Bar in SDI and MDI Applications Fayetteville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Forest City NC
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Bragg NC
- Code to View/Hide Status Bar in SDI and MDI Applications Fuquay Varina NC
- Code to View/Hide Status Bar in SDI and MDI Applications Garner NC
- Code to View/Hide Status Bar in SDI and MDI Applications Gastonia NC
- Code to View/Hide Status Bar in SDI and MDI Applications Goldsboro NC
- Code to View/Hide Status Bar in SDI and MDI Applications Granite Falls NC
- Code to View/Hide Status Bar in SDI and MDI Applications Greensboro NC
- Code to View/Hide Status Bar in SDI and MDI Applications Greenville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Havelock NC
- Code to View/Hide Status Bar in SDI and MDI Applications Henderson NC
- Code to View/Hide Status Bar in SDI and MDI Applications Hendersonville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Hickory NC
- Code to View/Hide Status Bar in SDI and MDI Applications High Point NC
- Code to View/Hide Status Bar in SDI and MDI Applications Hillsborough NC
- Code to View/Hide Status Bar in SDI and MDI Applications Hope Mills NC
- Code to View/Hide Status Bar in SDI and MDI Applications Huntersville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Jacksonville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Kannapolis NC
- Code to View/Hide Status Bar in SDI and MDI Applications Kernersville NC
- Code to View/Hide Status Bar in SDI and MDI Applications King NC
- Code to View/Hide Status Bar in SDI and MDI Applications Kings Mountain NC
- Code to View/Hide Status Bar in SDI and MDI Applications Kinston NC
- Code to View/Hide Status Bar in SDI and MDI Applications Knightdale NC
- Code to View/Hide Status Bar in SDI and MDI Applications Laurinburg NC
- Code to View/Hide Status Bar in SDI and MDI Applications Leland NC
- Code to View/Hide Status Bar in SDI and MDI Applications Lenoir NC
- Code to View/Hide Status Bar in SDI and MDI Applications Lexington NC
- Code to View/Hide Status Bar in SDI and MDI Applications Lillington NC
- Code to View/Hide Status Bar in SDI and MDI Applications Lincolnton NC
- Code to View/Hide Status Bar in SDI and MDI Applications Louisburg NC
- Code to View/Hide Status Bar in SDI and MDI Applications Lumberton NC
- Code to View/Hide Status Bar in SDI and MDI Applications Marion NC
- Code to View/Hide Status Bar in SDI and MDI Applications Matthews NC
- Code to View/Hide Status Bar in SDI and MDI Applications Mebane NC
- Code to View/Hide Status Bar in SDI and MDI Applications Mocksville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Monroe NC
- Code to View/Hide Status Bar in SDI and MDI Applications Mooresville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Morganton NC
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Airy NC
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Olive NC
- Code to View/Hide Status Bar in SDI and MDI Applications Murphy NC
- Code to View/Hide Status Bar in SDI and MDI Applications New Bern NC
- Code to View/Hide Status Bar in SDI and MDI Applications North Wilkesboro NC
- Code to View/Hide Status Bar in SDI and MDI Applications Raeford NC
- Code to View/Hide Status Bar in SDI and MDI Applications Raleigh NC
- Code to View/Hide Status Bar in SDI and MDI Applications Reidsville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Roanoke Rapids NC
- Code to View/Hide Status Bar in SDI and MDI Applications Rockingham NC
- Code to View/Hide Status Bar in SDI and MDI Applications Rocky Mount NC
- Code to View/Hide Status Bar in SDI and MDI Applications Roxboro NC
- Code to View/Hide Status Bar in SDI and MDI Applications Rutherfordton NC
- Code to View/Hide Status Bar in SDI and MDI Applications Salisbury NC
- Code to View/Hide Status Bar in SDI and MDI Applications Sanford NC
- Code to View/Hide Status Bar in SDI and MDI Applications Shelby NC
- Code to View/Hide Status Bar in SDI and MDI Applications Siler City NC
- Code to View/Hide Status Bar in SDI and MDI Applications Statesville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Tarboro NC
- Code to View/Hide Status Bar in SDI and MDI Applications Taylorsville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Thomasville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Trinity NC
- Code to View/Hide Status Bar in SDI and MDI Applications Wake Forest NC
- Code to View/Hide Status Bar in SDI and MDI Applications Waxhaw NC
- Code to View/Hide Status Bar in SDI and MDI Applications Waynesville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Weaverville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Wendell NC
- Code to View/Hide Status Bar in SDI and MDI Applications Whiteville NC
- Code to View/Hide Status Bar in SDI and MDI Applications Williamston NC
- Code to View/Hide Status Bar in SDI and MDI Applications Wilmington NC
- Code to View/Hide Status Bar in SDI and MDI Applications Wilson NC
- Code to View/Hide Status Bar in SDI and MDI Applications Winston Salem NC
- Code to View/Hide Status Bar in SDI and MDI Applications Zebulon NC
Related Local Events
Breakfast & Business (PWN)
Dates: 11/24/2009 - 11/24/2009
Location: Durham Chamber
Durham, NC
View Details

Breakfast & Business (PWN)
Dates: 11/24/2009 - 11/24/2009
Location: Durham Chamber
Durham, NC
View Details

North Carolina Legislative Holiday Reception (Govt. Affairs)
Dates: 12/3/2009 - 12/3/2009
Location: Washington Duke Inn & Golf Club
Durham, NC
View Details

North Carolina Legislative Holiday Reception (Govt. Affairs)
Dates: 12/3/2009 - 12/3/2009
Location: Washington Duke Inn & Golf Club
Durham, NC
View Details

Automation Technology Expo South
Dates: 4/28/2010 - 4/29/2010
Location: Charlotte Convention Center
Charlotte, NC
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