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

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

Softwyre
(501) 734-0017
804 Edgewood
Maumelle,, AR
Applied Technology Group
(501) 372-2373
3201 US Highway 161
North Little, AR
Pearce Enterprises
(501) 833-8773
1103 E Woodruff Ave
Sherwood, AR
Jones Internet Services
(870) 802-2029
520 Carson St
Jonesboro, AR
Hail Technologies Inc
(870) 793-2600
1086 E College St
Batesville, AR
Computer Consultants of Nwa Inc.
(479) 751-7171
Springdale, AR
Genesis Broadband
(501) 707-0175
5 Chowing Cv
Little Rock, AR
Green Goblin Unlimited
(501) 350-4562
Little Rock, AR
Q V Systems Ltd
(479) 876-5200
60 Lyndhurst Dr
Bella Vista, AR
Ridge Marketing Group
(501) 336-0444
Conway, AR

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

Softwyre

5017340017
804 Edgewood
Maumelle,, AR

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Arkadelphia AR
- Code to View/Hide Status Bar in SDI and MDI Applications Bella Vista AR
- Code to View/Hide Status Bar in SDI and MDI Applications Benton AR
- Code to View/Hide Status Bar in SDI and MDI Applications Bentonville AR
- Code to View/Hide Status Bar in SDI and MDI Applications Blytheville AR
- Code to View/Hide Status Bar in SDI and MDI Applications Cabot AR
- Code to View/Hide Status Bar in SDI and MDI Applications Conway AR
- Code to View/Hide Status Bar in SDI and MDI Applications El Dorado AR
- Code to View/Hide Status Bar in SDI and MDI Applications Fayetteville AR
- Code to View/Hide Status Bar in SDI and MDI Applications Forrest City AR
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Smith AR
- Code to View/Hide Status Bar in SDI and MDI Applications Harrison AR
- Code to View/Hide Status Bar in SDI and MDI Applications Hope AR
- Code to View/Hide Status Bar in SDI and MDI Applications Hot Springs National Park AR
- Code to View/Hide Status Bar in SDI and MDI Applications Jacksonville AR
- Code to View/Hide Status Bar in SDI and MDI Applications Jonesboro AR
- Code to View/Hide Status Bar in SDI and MDI Applications Little Rock AR
- Code to View/Hide Status Bar in SDI and MDI Applications Mountain Home AR
- Code to View/Hide Status Bar in SDI and MDI Applications North Little Rock AR
- Code to View/Hide Status Bar in SDI and MDI Applications Paragould AR
- Code to View/Hide Status Bar in SDI and MDI Applications Pine Bluff AR
- Code to View/Hide Status Bar in SDI and MDI Applications Rogers AR
- Code to View/Hide Status Bar in SDI and MDI Applications Russellville AR
- Code to View/Hide Status Bar in SDI and MDI Applications Searcy AR
- Code to View/Hide Status Bar in SDI and MDI Applications Sherwood AR
- Code to View/Hide Status Bar in SDI and MDI Applications Siloam Springs AR
- Code to View/Hide Status Bar in SDI and MDI Applications Springdale AR
- Code to View/Hide Status Bar in SDI and MDI Applications Texarkana AR
- Code to View/Hide Status Bar in SDI and MDI Applications Van Buren AR
- Code to View/Hide Status Bar in SDI and MDI Applications West Memphis AR
- Code to View/Hide Status Bar in SDI and MDI Applications White Hall AR

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