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

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

Twin Cities Solutions, Inc.
952.881.6570
10800 Lyndale Ave S
Bloomington, MN
American Software and Global Technologies
(952) 885-5640
1650 W 82nd St
Minneapolis, MN
Lawson Software
651-767-7000
380 Saint Peter St
St. Paul, MN
Assessment Systems
651-647-9220
2233 University Ave W
St. Paul, MN
Automation Station Inc
651-224-1985
180 5th St E
St. Paul, MN
3 Sixty Software, LLC
612-961-0787
4209 Heathcote Rd
Wayzata, MN
Global Software
(612) 305-4472
10 S 5th St
Minneapolis, MN
Genuine Genuis Solutions
(612) 872-4256
431 Clifton Ave
Minneapolis, MN
Notion IT
(507) 276-9149
820 Sunrise Dr.
New Ulm, MN
Productive Corporation
612.375.0204
510 First Ave North Suite 310
Minneapolis, MN

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

Twin Cities Solutions, Inc.

Twin Cities Solutions, Inc. is a privately owned information technology solutions firm primarily engaged in providing technical an

952.881.6570
10800 Lyndale Ave S
Bloomington, MN
http://www.twincs.com

Twin Cities Solutions, Inc. is a privately owned information technology solutions firm primarily engaged in providing technical and project management expertise to application development initiatives.

We are experienced in providing information technology solutions to government agencies as well as manufacturing, legal, financial and publishing business sectors.

Our team of consultants provides expertise to our clients in several key areas: E-Commerce applications, distributed applications, database development and desktop support.

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Albert Lea MN
- Code to View/Hide Status Bar in SDI and MDI Applications Andover MN
- Code to View/Hide Status Bar in SDI and MDI Applications Anoka MN
- Code to View/Hide Status Bar in SDI and MDI Applications Bemidji MN
- Code to View/Hide Status Bar in SDI and MDI Applications Brainerd MN
- Code to View/Hide Status Bar in SDI and MDI Applications Burnsville MN
- Code to View/Hide Status Bar in SDI and MDI Applications Champlin MN
- Code to View/Hide Status Bar in SDI and MDI Applications Chanhassen MN
- Code to View/Hide Status Bar in SDI and MDI Applications Chaska MN
- Code to View/Hide Status Bar in SDI and MDI Applications Circle Pines MN
- Code to View/Hide Status Bar in SDI and MDI Applications Cloquet MN
- Code to View/Hide Status Bar in SDI and MDI Applications Cottage Grove MN
- Code to View/Hide Status Bar in SDI and MDI Applications Detroit Lakes MN
- Code to View/Hide Status Bar in SDI and MDI Applications Duluth MN
- Code to View/Hide Status Bar in SDI and MDI Applications Eden Prairie MN
- Code to View/Hide Status Bar in SDI and MDI Applications Elk River MN
- Code to View/Hide Status Bar in SDI and MDI Applications Excelsior MN
- Code to View/Hide Status Bar in SDI and MDI Applications Faribault MN
- Code to View/Hide Status Bar in SDI and MDI Applications Fergus Falls MN
- Code to View/Hide Status Bar in SDI and MDI Applications Forest Lake MN
- Code to View/Hide Status Bar in SDI and MDI Applications Hastings MN
- Code to View/Hide Status Bar in SDI and MDI Applications Hibbing MN
- Code to View/Hide Status Bar in SDI and MDI Applications Hopkins MN
- Code to View/Hide Status Bar in SDI and MDI Applications Inver Grove Heights MN
- Code to View/Hide Status Bar in SDI and MDI Applications Lakeville MN
- Code to View/Hide Status Bar in SDI and MDI Applications Mankato MN
- Code to View/Hide Status Bar in SDI and MDI Applications Minneapolis MN
- Code to View/Hide Status Bar in SDI and MDI Applications Minnetonka MN
- Code to View/Hide Status Bar in SDI and MDI Applications Moorhead MN
- Code to View/Hide Status Bar in SDI and MDI Applications Mound MN
- Code to View/Hide Status Bar in SDI and MDI Applications New Ulm MN
- Code to View/Hide Status Bar in SDI and MDI Applications Osseo MN
- Code to View/Hide Status Bar in SDI and MDI Applications Owatonna MN
- Code to View/Hide Status Bar in SDI and MDI Applications Prior Lake MN
- Code to View/Hide Status Bar in SDI and MDI Applications Red Wing MN
- Code to View/Hide Status Bar in SDI and MDI Applications Rochester MN
- Code to View/Hide Status Bar in SDI and MDI Applications Rosemount MN
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Cloud MN
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Paul MN
- Code to View/Hide Status Bar in SDI and MDI Applications Savage MN
- Code to View/Hide Status Bar in SDI and MDI Applications Shakopee MN
- Code to View/Hide Status Bar in SDI and MDI Applications South Saint Paul MN
- Code to View/Hide Status Bar in SDI and MDI Applications Stillwater MN
- Code to View/Hide Status Bar in SDI and MDI Applications Wayzata MN
- Code to View/Hide Status Bar in SDI and MDI Applications Willmar MN
- Code to View/Hide Status Bar in SDI and MDI Applications Winona MN

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