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

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

Desktop Solutions
614-884-3714
3021 Bethel RD
Columbus, OH
Megasys Software Services
614-457-5544
1681 Old Henderson RD
Columbus, OH
Valent Software
614-457-9000
2000 Henderson RD
Columbus, OH
Ventech Solutions
614-751-1167
950 Taylor Station Rd
Columbus, OH
Technology Software Inc
614-442-8400
1505 Bethel RD
Columbus, OH
Teamwork Solutions
614-457-7100
1880 Mackenzie DR
Columbus, OH
Priority One Solutions
216-298-4020
2130 Superior Ave E
Cleveland, OH
Crystal Vision Software
419-472-0000
3601 W Alexis RD
Toledo, OH
F 1 Technologies
419-255-6366
2108 Glenwood Ave
Toledo, OH
ProTrain & True North Career Services Inc.
(513) 825-1555
650 Northland Boulevard
Cincinnati, OH

 

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

Desktop Solutions

614-884-3714
3021 Bethel RD
Columbus, OH

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Akron OH
- Code to View/Hide Status Bar in SDI and MDI Applications Alliance OH
- Code to View/Hide Status Bar in SDI and MDI Applications Amelia OH
- Code to View/Hide Status Bar in SDI and MDI Applications Ashland OH
- Code to View/Hide Status Bar in SDI and MDI Applications Ashtabula OH
- Code to View/Hide Status Bar in SDI and MDI Applications Athens OH
- Code to View/Hide Status Bar in SDI and MDI Applications Avon Lake OH
- Code to View/Hide Status Bar in SDI and MDI Applications Barberton OH
- Code to View/Hide Status Bar in SDI and MDI Applications Batavia OH
- Code to View/Hide Status Bar in SDI and MDI Applications Bay Village OH
- Code to View/Hide Status Bar in SDI and MDI Applications Beachwood OH
- Code to View/Hide Status Bar in SDI and MDI Applications Bedford OH
- Code to View/Hide Status Bar in SDI and MDI Applications Bellefontaine OH
- Code to View/Hide Status Bar in SDI and MDI Applications Bowling Green OH
- Code to View/Hide Status Bar in SDI and MDI Applications Broadview Heights OH
- Code to View/Hide Status Bar in SDI and MDI Applications Brook Park OH
- Code to View/Hide Status Bar in SDI and MDI Applications Brunswick OH
- Code to View/Hide Status Bar in SDI and MDI Applications Bucyrus OH
- Code to View/Hide Status Bar in SDI and MDI Applications Canal Winchester OH
- Code to View/Hide Status Bar in SDI and MDI Applications Canfield OH
- Code to View/Hide Status Bar in SDI and MDI Applications Canton OH
- Code to View/Hide Status Bar in SDI and MDI Applications Celina OH
- Code to View/Hide Status Bar in SDI and MDI Applications Chagrin Falls OH
- Code to View/Hide Status Bar in SDI and MDI Applications Chardon OH
- Code to View/Hide Status Bar in SDI and MDI Applications Chillicothe OH
- Code to View/Hide Status Bar in SDI and MDI Applications Cincinnati OH
- Code to View/Hide Status Bar in SDI and MDI Applications Circleville OH
- Code to View/Hide Status Bar in SDI and MDI Applications Cleveland OH
- Code to View/Hide Status Bar in SDI and MDI Applications Columbus OH
- Code to View/Hide Status Bar in SDI and MDI Applications Conneaut OH
- Code to View/Hide Status Bar in SDI and MDI Applications Coshocton OH
- Code to View/Hide Status Bar in SDI and MDI Applications Cuyahoga Falls OH
- Code to View/Hide Status Bar in SDI and MDI Applications Dayton OH
- Code to View/Hide Status Bar in SDI and MDI Applications Defiance OH
- Code to View/Hide Status Bar in SDI and MDI Applications Delaware OH
- Code to View/Hide Status Bar in SDI and MDI Applications Dublin OH
- Code to View/Hide Status Bar in SDI and MDI Applications East Liverpool OH
- Code to View/Hide Status Bar in SDI and MDI Applications Eastlake OH
- Code to View/Hide Status Bar in SDI and MDI Applications Eaton OH
- Code to View/Hide Status Bar in SDI and MDI Applications Elyria OH
- Code to View/Hide Status Bar in SDI and MDI Applications Euclid OH
- Code to View/Hide Status Bar in SDI and MDI Applications Fairborn OH
- Code to View/Hide Status Bar in SDI and MDI Applications Fairfield OH
- Code to View/Hide Status Bar in SDI and MDI Applications Findlay OH
- Code to View/Hide Status Bar in SDI and MDI Applications Fostoria OH
- Code to View/Hide Status Bar in SDI and MDI Applications Franklin OH
- Code to View/Hide Status Bar in SDI and MDI Applications Fremont OH
- Code to View/Hide Status Bar in SDI and MDI Applications Galion OH
- Code to View/Hide Status Bar in SDI and MDI Applications Gallipolis OH
- Code to View/Hide Status Bar in SDI and MDI Applications Galloway OH
- Code to View/Hide Status Bar in SDI and MDI Applications Girard OH
- Code to View/Hide Status Bar in SDI and MDI Applications Grove City OH
- Code to View/Hide Status Bar in SDI and MDI Applications Hamilton OH
- Code to View/Hide Status Bar in SDI and MDI Applications Heath OH
- Code to View/Hide Status Bar in SDI and MDI Applications Hilliard OH
- Code to View/Hide Status Bar in SDI and MDI Applications Hubbard OH
- Code to View/Hide Status Bar in SDI and MDI Applications Ironton OH
- Code to View/Hide Status Bar in SDI and MDI Applications Kent OH
- Code to View/Hide Status Bar in SDI and MDI Applications Lakewood OH
- Code to View/Hide Status Bar in SDI and MDI Applications Lancaster OH
- Code to View/Hide Status Bar in SDI and MDI Applications Lebanon OH
- Code to View/Hide Status Bar in SDI and MDI Applications Lima OH
- Code to View/Hide Status Bar in SDI and MDI Applications Lorain OH
- Code to View/Hide Status Bar in SDI and MDI Applications Loveland OH
- Code to View/Hide Status Bar in SDI and MDI Applications Madison OH
- Code to View/Hide Status Bar in SDI and MDI Applications Maineville OH
- Code to View/Hide Status Bar in SDI and MDI Applications Mansfield OH
- Code to View/Hide Status Bar in SDI and MDI Applications Maple Heights OH
- Code to View/Hide Status Bar in SDI and MDI Applications Marion OH
- Code to View/Hide Status Bar in SDI and MDI Applications Marysville OH
- Code to View/Hide Status Bar in SDI and MDI Applications Mason OH
- Code to View/Hide Status Bar in SDI and MDI Applications Massillon OH
- Code to View/Hide Status Bar in SDI and MDI Applications Maumee OH
- Code to View/Hide Status Bar in SDI and MDI Applications Medina OH
- Code to View/Hide Status Bar in SDI and MDI Applications Mentor OH
- Code to View/Hide Status Bar in SDI and MDI Applications Miamisburg OH
- Code to View/Hide Status Bar in SDI and MDI Applications Middletown OH
- Code to View/Hide Status Bar in SDI and MDI Applications Milford OH
- Code to View/Hide Status Bar in SDI and MDI Applications Millersburg OH
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Vernon OH
- Code to View/Hide Status Bar in SDI and MDI Applications Napoleon OH
- Code to View/Hide Status Bar in SDI and MDI Applications New Carlisle OH
- Code to View/Hide Status Bar in SDI and MDI Applications New Philadelphia OH
- Code to View/Hide Status Bar in SDI and MDI Applications Newark OH
- Code to View/Hide Status Bar in SDI and MDI Applications North Olmsted OH
- Code to View/Hide Status Bar in SDI and MDI Applications North Ridgeville OH
- Code to View/Hide Status Bar in SDI and MDI Applications North Royalton OH
- Code to View/Hide Status Bar in SDI and MDI Applications Olmsted Falls OH
- Code to View/Hide Status Bar in SDI and MDI Applications Oregon OH
- Code to View/Hide Status Bar in SDI and MDI Applications Oxford OH
- Code to View/Hide Status Bar in SDI and MDI Applications Painesville OH
- Code to View/Hide Status Bar in SDI and MDI Applications Pataskala OH
- Code to View/Hide Status Bar in SDI and MDI Applications Perrysburg OH
- Code to View/Hide Status Bar in SDI and MDI Applications Pickerington OH
- Code to View/Hide Status Bar in SDI and MDI Applications Piqua OH
- Code to View/Hide Status Bar in SDI and MDI Applications Portsmouth OH
- Code to View/Hide Status Bar in SDI and MDI Applications Ravenna OH
- Code to View/Hide Status Bar in SDI and MDI Applications Reynoldsburg OH
- Code to View/Hide Status Bar in SDI and MDI Applications Rocky River OH
- Code to View/Hide Status Bar in SDI and MDI Applications Salem OH
- Code to View/Hide Status Bar in SDI and MDI Applications Sandusky OH
- Code to View/Hide Status Bar in SDI and MDI Applications Sidney OH
- Code to View/Hide Status Bar in SDI and MDI Applications Solon OH
- Code to View/Hide Status Bar in SDI and MDI Applications Springboro OH
- Code to View/Hide Status Bar in SDI and MDI Applications Springfield OH
- Code to View/Hide Status Bar in SDI and MDI Applications Steubenville OH
- Code to View/Hide Status Bar in SDI and MDI Applications Stow OH
- Code to View/Hide Status Bar in SDI and MDI Applications Strongsville OH
- Code to View/Hide Status Bar in SDI and MDI Applications Sylvania OH
- Code to View/Hide Status Bar in SDI and MDI Applications Tallmadge OH
- Code to View/Hide Status Bar in SDI and MDI Applications Tiffin OH
- Code to View/Hide Status Bar in SDI and MDI Applications Tipp City OH
- Code to View/Hide Status Bar in SDI and MDI Applications Toledo OH
- Code to View/Hide Status Bar in SDI and MDI Applications Troy OH
- Code to View/Hide Status Bar in SDI and MDI Applications Twinsburg OH
- Code to View/Hide Status Bar in SDI and MDI Applications Van Wert OH
- Code to View/Hide Status Bar in SDI and MDI Applications Vandalia OH
- Code to View/Hide Status Bar in SDI and MDI Applications Vermilion OH
- Code to View/Hide Status Bar in SDI and MDI Applications Wadsworth OH
- Code to View/Hide Status Bar in SDI and MDI Applications Wapakoneta OH
- Code to View/Hide Status Bar in SDI and MDI Applications Warren OH
- Code to View/Hide Status Bar in SDI and MDI Applications Washington Court House OH
- Code to View/Hide Status Bar in SDI and MDI Applications West Chester OH
- Code to View/Hide Status Bar in SDI and MDI Applications Westerville OH
- Code to View/Hide Status Bar in SDI and MDI Applications Westlake OH
- Code to View/Hide Status Bar in SDI and MDI Applications Wickliffe OH
- Code to View/Hide Status Bar in SDI and MDI Applications Willoughby OH
- Code to View/Hide Status Bar in SDI and MDI Applications Wooster OH
- Code to View/Hide Status Bar in SDI and MDI Applications Xenia OH
- Code to View/Hide Status Bar in SDI and MDI Applications Youngstown OH
- Code to View/Hide Status Bar in SDI and MDI Applications Zanesville OH
Related Local Events
NAIAS 2010
Dates: 1/15/2010 - 1/15/2010
Location: COBO Convention Center
Detroit, OH
View Details

Forge Fair 2010
Dates: 4/20/2010 - 4/22/2010
Location: Cincinnati Convention Center
Cincinnati, OH
View Details

Earth Science Day
Dates: 10/17/2009 - 10/17/2009
Location: Cleveland Museum of Natural History
Cleveland, OH
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