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

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

ClearStar.net
360-892-0687
915 Broadway
Vancouver, WA
Free Data Recovery Software
001-991-1111 x111
lane
State, WA
Advanced Clinical Software
206-728-0313
2212 4th Ave
Seattle, WA
Benaroya Research Institute at Virginia Mason
(206) 341-1313
1201 9th Ave.
Seattle, WA
BioLife Solutions, Inc.
(425) 402-1400
3303 Monte Villa Pkwy, Ste. 310
Seattle, WA
Dendreon Corporation
(206) 256-4545
3005 1st Ave.
Seattle, WA
IMAGINiT Technologies, Inc.
(206) 682-8032
2101 4th Ave.,
Seattle, WA
Advanced Computer Solutions Ltd.
(206) 624-7854
500 Union St.,
Seattle, WA
Coolearth Technologies, Inc.
(206) 770-9061
226 S Orcas St.
Seattle, WA
Envision Telephony, Inc.
(206) 621-9384
520 Pike St.,
Seattle, WA

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

ClearStar.net

360-892-0687
915 Broadway
Vancouver, WA
www.clearstar.net

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Anacortes WA
- Code to View/Hide Status Bar in SDI and MDI Applications Arlington WA
- Code to View/Hide Status Bar in SDI and MDI Applications Auburn WA
- Code to View/Hide Status Bar in SDI and MDI Applications Bainbridge Island WA
- Code to View/Hide Status Bar in SDI and MDI Applications Battle Ground WA
- Code to View/Hide Status Bar in SDI and MDI Applications Bellevue WA
- Code to View/Hide Status Bar in SDI and MDI Applications Bellingham WA
- Code to View/Hide Status Bar in SDI and MDI Applications Bothell WA
- Code to View/Hide Status Bar in SDI and MDI Applications Bremerton WA
- Code to View/Hide Status Bar in SDI and MDI Applications Buckley WA
- Code to View/Hide Status Bar in SDI and MDI Applications Camas WA
- Code to View/Hide Status Bar in SDI and MDI Applications Chehalis WA
- Code to View/Hide Status Bar in SDI and MDI Applications Cheney WA
- Code to View/Hide Status Bar in SDI and MDI Applications East Wenatchee WA
- Code to View/Hide Status Bar in SDI and MDI Applications Edmonds WA
- Code to View/Hide Status Bar in SDI and MDI Applications Ellensburg WA
- Code to View/Hide Status Bar in SDI and MDI Applications Enumclaw WA
- Code to View/Hide Status Bar in SDI and MDI Applications Everett WA
- Code to View/Hide Status Bar in SDI and MDI Applications Federal Way WA
- Code to View/Hide Status Bar in SDI and MDI Applications Gig Harbor WA
- Code to View/Hide Status Bar in SDI and MDI Applications Issaquah WA
- Code to View/Hide Status Bar in SDI and MDI Applications Kelso WA
- Code to View/Hide Status Bar in SDI and MDI Applications Kenmore WA
- Code to View/Hide Status Bar in SDI and MDI Applications Kennewick WA
- Code to View/Hide Status Bar in SDI and MDI Applications Kent WA
- Code to View/Hide Status Bar in SDI and MDI Applications Kirkland WA
- Code to View/Hide Status Bar in SDI and MDI Applications Lacey WA
- Code to View/Hide Status Bar in SDI and MDI Applications Lake Stevens WA
- Code to View/Hide Status Bar in SDI and MDI Applications Lakewood WA
- Code to View/Hide Status Bar in SDI and MDI Applications Longview WA
- Code to View/Hide Status Bar in SDI and MDI Applications Lynden WA
- Code to View/Hide Status Bar in SDI and MDI Applications Lynnwood WA
- Code to View/Hide Status Bar in SDI and MDI Applications Maple Valley WA
- Code to View/Hide Status Bar in SDI and MDI Applications Marysville WA
- Code to View/Hide Status Bar in SDI and MDI Applications Mercer Island WA
- Code to View/Hide Status Bar in SDI and MDI Applications Moses Lake WA
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Vernon WA
- Code to View/Hide Status Bar in SDI and MDI Applications Mountlake Terrace WA
- Code to View/Hide Status Bar in SDI and MDI Applications Mukilteo WA
- Code to View/Hide Status Bar in SDI and MDI Applications Oak Harbor WA
- Code to View/Hide Status Bar in SDI and MDI Applications Olympia WA
- Code to View/Hide Status Bar in SDI and MDI Applications Pasco WA
- Code to View/Hide Status Bar in SDI and MDI Applications Port Angeles WA
- Code to View/Hide Status Bar in SDI and MDI Applications Port Orchard WA
- Code to View/Hide Status Bar in SDI and MDI Applications Poulsbo WA
- Code to View/Hide Status Bar in SDI and MDI Applications Pullman WA
- Code to View/Hide Status Bar in SDI and MDI Applications Puyallup WA
- Code to View/Hide Status Bar in SDI and MDI Applications Redmond WA
- Code to View/Hide Status Bar in SDI and MDI Applications Renton WA
- Code to View/Hide Status Bar in SDI and MDI Applications Richland WA
- Code to View/Hide Status Bar in SDI and MDI Applications Seattle WA
- Code to View/Hide Status Bar in SDI and MDI Applications Sedro Woolley WA
- Code to View/Hide Status Bar in SDI and MDI Applications Selah WA
- Code to View/Hide Status Bar in SDI and MDI Applications Sequim WA
- Code to View/Hide Status Bar in SDI and MDI Applications Shelton WA
- Code to View/Hide Status Bar in SDI and MDI Applications Silverdale WA
- Code to View/Hide Status Bar in SDI and MDI Applications Snohomish WA
- Code to View/Hide Status Bar in SDI and MDI Applications Spanaway WA
- Code to View/Hide Status Bar in SDI and MDI Applications Spokane WA
- Code to View/Hide Status Bar in SDI and MDI Applications Stanwood WA
- Code to View/Hide Status Bar in SDI and MDI Applications Sumner WA
- Code to View/Hide Status Bar in SDI and MDI Applications Tacoma WA
- Code to View/Hide Status Bar in SDI and MDI Applications University Place WA
- Code to View/Hide Status Bar in SDI and MDI Applications Vancouver WA
- Code to View/Hide Status Bar in SDI and MDI Applications Washougal WA
- Code to View/Hide Status Bar in SDI and MDI Applications Wenatchee WA
- Code to View/Hide Status Bar in SDI and MDI Applications Woodinville WA
- Code to View/Hide Status Bar in SDI and MDI Applications Yakima WA
- Code to View/Hide Status Bar in SDI and MDI Applications Yelm WA
Related Local Events
Leads Group: Wired
Dates: 11/26/2009 - 11/26/2009
Location: Mud Bay Coffee
Olympia, WA
View Details

Leads Group: Wired
Dates: 12/3/2009 - 12/3/2009
Location: Mud Bay Coffee
Olympia, WA
View Details

Leads Group: Wired
Dates: 12/13/2009 - 12/13/2009
Location: Mud Bay Coffee
Olympia, WA
View Details

Leads Group: Wired
Dates: 12/24/2009 - 12/24/2009
Location: Mud Bay Coffee
Olympia, WA
View Details

Leads Group: Wired
Dates: 12/31/2009 - 12/31/2009
Location: Mud Bay Coffee
Olympia, WA
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