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

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

Janalent
(888)2904870
3291 E Warm Springs Rd Ste 300
Las Vegas, NV
Rentex Inc
(800)3044819
3585 E Patrick Ln Ste 1200
Las Vegas, NV
Sparkplug
(702)5058094
3744 Civic Center Dr
N Las Vegas, NV
Check Point Software
(702) 633-7778
823 Vineyard Vine Way
North Las Vegas, NV
IT Dev, Inc.
(888)3330477
3365 E Flamingo Rd Ste 5
Henderson, NV
Intertech Computers
(702)4534433
3321 Sunrise Ave Ste 105
Las Vegas, NV
Akers & Associates, Inc.
(702)8662316
720 S 4th St Ste 305
Las Vegas, NV
Conrad & Company
(702) 699-9034
5101 Tropical Rain St
North Las Vegas, NV
P.O. Interests, Inc.
(702)8963822
2628 Langford Ave
Las Vegas, NV
RetailSystems, Inc.
(702)6170427
346 Pleasant Summit Dr
Henderson, NV

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

Janalent

(888)2904870
3291 E Warm Springs Rd Ste 300
Las Vegas, NV

Related Local Events
POWER-GEN International 2009
Dates: 12/8/2009 - 12/10/2009
Location: Las Vegas Convention Center
Las Vegas, NV
View Details

2010 7th IEEE Consumer Communications and Networking Conference (CCNC)
Dates: 1/10/2010 - 1/12/2010
Location: Harrahs Las Vegas Hotel and Casino
Las Vegas, NV
View Details

Northern Nevada Regional Business & Tech Show
Dates: 10/16/2020 - 10/16/2020
Location: .A. Nugget, Sparks
Sparks, NV
View Details

Mobile Business Expo
Dates: 11/16/2009 - 11/20/2009
Location: Mandalay Bay Resort & Casino Convention Center
Las Vegas, NV
View Details

International Telemetering Conference
Dates: 10/26/2009 - 10/29/2009
Location: Riviera Hotel & Conference Center, Las Vegas
Las Vegas, NV
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