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

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

Practice Management Solutions Inc
414-352-8160
7571 N Teutonia Ave
Milwaukee, WI
codeeo
608 305 1060
1360 Regent Street #155
Madison, WI
Gates Business Solutions
608-661-0810
2810 CrossRoads DR
Madison, WI
Madison Software Inc
608-833-5410
6666 Odana Rd
Madison, WI
Electroniclaim
262-240-9700
11357 N. Port Washington Rd
Mequon, WI
KMSpecialties
414-751-4009
7434-3 Halverson Rd
Three Lakes, WI
Image Processing Software Inc
608-233-5033
6409 Appalachian Way
Madison, WI
Gbl Software LLC
414-760-9029
6417 W Hustis St
Milwaukee, WI
Access Technologies International
414-289-3121
840 N Old World 3rd St
Milwaukee, WI
Guild Software Inc
414-259-0959
10437 W Innovation DR
Milwaukee, WI

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

Practice Management Solutions Inc

414-352-8160
7571 N Teutonia Ave
Milwaukee, WI

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Appleton WI
- Code to View/Hide Status Bar in SDI and MDI Applications Baraboo WI
- Code to View/Hide Status Bar in SDI and MDI Applications Beaver Dam WI
- Code to View/Hide Status Bar in SDI and MDI Applications Beloit WI
- Code to View/Hide Status Bar in SDI and MDI Applications Brookfield WI
- Code to View/Hide Status Bar in SDI and MDI Applications Burlington WI
- Code to View/Hide Status Bar in SDI and MDI Applications Cedarburg WI
- Code to View/Hide Status Bar in SDI and MDI Applications Chippewa Falls WI
- Code to View/Hide Status Bar in SDI and MDI Applications Cudahy WI
- Code to View/Hide Status Bar in SDI and MDI Applications De Pere WI
- Code to View/Hide Status Bar in SDI and MDI Applications Delavan WI
- Code to View/Hide Status Bar in SDI and MDI Applications Eau Claire WI
- Code to View/Hide Status Bar in SDI and MDI Applications Elkhorn WI
- Code to View/Hide Status Bar in SDI and MDI Applications Fond Du Lac WI
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Atkinson WI
- Code to View/Hide Status Bar in SDI and MDI Applications Franklin WI
- Code to View/Hide Status Bar in SDI and MDI Applications Green Bay WI
- Code to View/Hide Status Bar in SDI and MDI Applications Hartland WI
- Code to View/Hide Status Bar in SDI and MDI Applications Janesville WI
- Code to View/Hide Status Bar in SDI and MDI Applications Kaukauna WI
- Code to View/Hide Status Bar in SDI and MDI Applications Kenosha WI
- Code to View/Hide Status Bar in SDI and MDI Applications La Crosse WI
- Code to View/Hide Status Bar in SDI and MDI Applications Lake Geneva WI
- Code to View/Hide Status Bar in SDI and MDI Applications Madison WI
- Code to View/Hide Status Bar in SDI and MDI Applications Manitowoc WI
- Code to View/Hide Status Bar in SDI and MDI Applications Marinette WI
- Code to View/Hide Status Bar in SDI and MDI Applications Marshfield WI
- Code to View/Hide Status Bar in SDI and MDI Applications Menasha WI
- Code to View/Hide Status Bar in SDI and MDI Applications Menomonee Falls WI
- Code to View/Hide Status Bar in SDI and MDI Applications Menomonie WI
- Code to View/Hide Status Bar in SDI and MDI Applications Merrill WI
- Code to View/Hide Status Bar in SDI and MDI Applications Middleton WI
- Code to View/Hide Status Bar in SDI and MDI Applications Milwaukee WI
- Code to View/Hide Status Bar in SDI and MDI Applications Mosinee WI
- Code to View/Hide Status Bar in SDI and MDI Applications Mukwonago WI
- Code to View/Hide Status Bar in SDI and MDI Applications Muskego WI
- Code to View/Hide Status Bar in SDI and MDI Applications Neenah WI
- Code to View/Hide Status Bar in SDI and MDI Applications New Berlin WI
- Code to View/Hide Status Bar in SDI and MDI Applications Oak Creek WI
- Code to View/Hide Status Bar in SDI and MDI Applications Oconomowoc WI
- Code to View/Hide Status Bar in SDI and MDI Applications Onalaska WI
- Code to View/Hide Status Bar in SDI and MDI Applications Oshkosh WI
- Code to View/Hide Status Bar in SDI and MDI Applications Pewaukee WI
- Code to View/Hide Status Bar in SDI and MDI Applications Racine WI
- Code to View/Hide Status Bar in SDI and MDI Applications Rhinelander WI
- Code to View/Hide Status Bar in SDI and MDI Applications Rice Lake WI
- Code to View/Hide Status Bar in SDI and MDI Applications River Falls WI
- Code to View/Hide Status Bar in SDI and MDI Applications Schofield WI
- Code to View/Hide Status Bar in SDI and MDI Applications Shawano WI
- Code to View/Hide Status Bar in SDI and MDI Applications Sheboygan WI
- Code to View/Hide Status Bar in SDI and MDI Applications South Milwaukee WI
- Code to View/Hide Status Bar in SDI and MDI Applications Stevens Point WI
- Code to View/Hide Status Bar in SDI and MDI Applications Sturgeon Bay WI
- Code to View/Hide Status Bar in SDI and MDI Applications Sun Prairie WI
- Code to View/Hide Status Bar in SDI and MDI Applications Superior WI
- Code to View/Hide Status Bar in SDI and MDI Applications Thiensville WI
- Code to View/Hide Status Bar in SDI and MDI Applications Two Rivers WI
- Code to View/Hide Status Bar in SDI and MDI Applications Watertown WI
- Code to View/Hide Status Bar in SDI and MDI Applications Waukesha WI
- Code to View/Hide Status Bar in SDI and MDI Applications Waupaca WI
- Code to View/Hide Status Bar in SDI and MDI Applications Wausau WI
- Code to View/Hide Status Bar in SDI and MDI Applications West Bend WI
- Code to View/Hide Status Bar in SDI and MDI Applications Whitewater WI
- Code to View/Hide Status Bar in SDI and MDI Applications Wisconsin Rapids WI

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