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

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

Corporate IT Source
248-396-1573
6841 N. Rochester Rd.
Rochester Hills, MI
Cms Software
313-965-4775
500 Griswold St
Detroit, MI
Protocol Syst C
313-534-8773
18201 W 8 Mile Rd
Detroit, MI
All About Technology
313-962-2430
2727 2nd Ave
Detroit, MI
Computer Power Store
313-640-4681
15411 Mack Ave
Detroit, MI
L & M Office Products
313-861-5707
8514 W Mcnichols RD
Detroit, MI
Keane Inc
248-356-2000
3000 Northwestern St
Detroit, MI
Sync Technologies
313-963-5353
2727 2nd Ave
Detroit, MI
Woodwing USA
313-962-0542
615 Griswold St
Detroit, MI
PC Menders Computer Services
313-397-2713
18256 Grand River Ave
Detroit, MI

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

Corporate IT Source

248-396-1573
6841 N. Rochester Rd.
Rochester Hills, MI

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Adrian MI
- Code to View/Hide Status Bar in SDI and MDI Applications Allegan MI
- Code to View/Hide Status Bar in SDI and MDI Applications Allen Park MI
- Code to View/Hide Status Bar in SDI and MDI Applications Alpena MI
- Code to View/Hide Status Bar in SDI and MDI Applications Ann Arbor MI
- Code to View/Hide Status Bar in SDI and MDI Applications Auburn Hills MI
- Code to View/Hide Status Bar in SDI and MDI Applications Battle Creek MI
- Code to View/Hide Status Bar in SDI and MDI Applications Bay City MI
- Code to View/Hide Status Bar in SDI and MDI Applications Belleville MI
- Code to View/Hide Status Bar in SDI and MDI Applications Benton Harbor MI
- Code to View/Hide Status Bar in SDI and MDI Applications Berkley MI
- Code to View/Hide Status Bar in SDI and MDI Applications Big Rapids MI
- Code to View/Hide Status Bar in SDI and MDI Applications Bloomfield Hills MI
- Code to View/Hide Status Bar in SDI and MDI Applications Brighton MI
- Code to View/Hide Status Bar in SDI and MDI Applications Burton MI
- Code to View/Hide Status Bar in SDI and MDI Applications Cadillac MI
- Code to View/Hide Status Bar in SDI and MDI Applications Canton MI
- Code to View/Hide Status Bar in SDI and MDI Applications Cheboygan MI
- Code to View/Hide Status Bar in SDI and MDI Applications Clarkston MI
- Code to View/Hide Status Bar in SDI and MDI Applications Clinton Township MI
- Code to View/Hide Status Bar in SDI and MDI Applications Clio MI
- Code to View/Hide Status Bar in SDI and MDI Applications Coldwater MI
- Code to View/Hide Status Bar in SDI and MDI Applications Commerce Township MI
- Code to View/Hide Status Bar in SDI and MDI Applications Comstock Park MI
- Code to View/Hide Status Bar in SDI and MDI Applications Davison MI
- Code to View/Hide Status Bar in SDI and MDI Applications Dearborn Heights MI
- Code to View/Hide Status Bar in SDI and MDI Applications Dearborn MI
- Code to View/Hide Status Bar in SDI and MDI Applications Detroit MI
- Code to View/Hide Status Bar in SDI and MDI Applications Dowagiac MI
- Code to View/Hide Status Bar in SDI and MDI Applications East Lansing MI
- Code to View/Hide Status Bar in SDI and MDI Applications Eastpointe MI
- Code to View/Hide Status Bar in SDI and MDI Applications Eaton Rapids MI
- Code to View/Hide Status Bar in SDI and MDI Applications Escanaba MI
- Code to View/Hide Status Bar in SDI and MDI Applications Farmington MI
- Code to View/Hide Status Bar in SDI and MDI Applications Fenton MI
- Code to View/Hide Status Bar in SDI and MDI Applications Ferndale MI
- Code to View/Hide Status Bar in SDI and MDI Applications Flat Rock MI
- Code to View/Hide Status Bar in SDI and MDI Applications Flint MI
- Code to View/Hide Status Bar in SDI and MDI Applications Flushing MI
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Gratiot MI
- Code to View/Hide Status Bar in SDI and MDI Applications Fraser MI
- Code to View/Hide Status Bar in SDI and MDI Applications Garden City MI
- Code to View/Hide Status Bar in SDI and MDI Applications Gaylord MI
- Code to View/Hide Status Bar in SDI and MDI Applications Gladwin MI
- Code to View/Hide Status Bar in SDI and MDI Applications Grand Blanc MI
- Code to View/Hide Status Bar in SDI and MDI Applications Grand Haven MI
- Code to View/Hide Status Bar in SDI and MDI Applications Grand Ledge MI
- Code to View/Hide Status Bar in SDI and MDI Applications Grand Rapids MI
- Code to View/Hide Status Bar in SDI and MDI Applications Grandville MI
- Code to View/Hide Status Bar in SDI and MDI Applications Grosse Pointe MI
- Code to View/Hide Status Bar in SDI and MDI Applications Hamtramck MI
- Code to View/Hide Status Bar in SDI and MDI Applications Harper Woods MI
- Code to View/Hide Status Bar in SDI and MDI Applications Harrison Township MI
- Code to View/Hide Status Bar in SDI and MDI Applications Hazel Park MI
- Code to View/Hide Status Bar in SDI and MDI Applications Highland Park MI
- Code to View/Hide Status Bar in SDI and MDI Applications Hillsdale MI
- Code to View/Hide Status Bar in SDI and MDI Applications Holland MI
- Code to View/Hide Status Bar in SDI and MDI Applications Holly MI
- Code to View/Hide Status Bar in SDI and MDI Applications Holt MI
- Code to View/Hide Status Bar in SDI and MDI Applications Howell MI
- Code to View/Hide Status Bar in SDI and MDI Applications Hudsonville MI
- Code to View/Hide Status Bar in SDI and MDI Applications Inkster MI
- Code to View/Hide Status Bar in SDI and MDI Applications Ionia MI
- Code to View/Hide Status Bar in SDI and MDI Applications Jackson MI
- Code to View/Hide Status Bar in SDI and MDI Applications Jenison MI
- Code to View/Hide Status Bar in SDI and MDI Applications Kalamazoo MI
- Code to View/Hide Status Bar in SDI and MDI Applications Lake Orion MI
- Code to View/Hide Status Bar in SDI and MDI Applications Lansing MI
- Code to View/Hide Status Bar in SDI and MDI Applications Lapeer MI
- Code to View/Hide Status Bar in SDI and MDI Applications Lincoln Park MI
- Code to View/Hide Status Bar in SDI and MDI Applications Livonia MI
- Code to View/Hide Status Bar in SDI and MDI Applications Ludington MI
- Code to View/Hide Status Bar in SDI and MDI Applications Macomb MI
- Code to View/Hide Status Bar in SDI and MDI Applications Marquette MI
- Code to View/Hide Status Bar in SDI and MDI Applications Midland MI
- Code to View/Hide Status Bar in SDI and MDI Applications Monroe MI
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Clemens MI
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Morris MI
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Pleasant MI
- Code to View/Hide Status Bar in SDI and MDI Applications Muskegon MI
- Code to View/Hide Status Bar in SDI and MDI Applications New Baltimore MI
- Code to View/Hide Status Bar in SDI and MDI Applications Niles MI
- Code to View/Hide Status Bar in SDI and MDI Applications Northville MI
- Code to View/Hide Status Bar in SDI and MDI Applications Novi MI
- Code to View/Hide Status Bar in SDI and MDI Applications Oak Park MI
- Code to View/Hide Status Bar in SDI and MDI Applications Okemos MI
- Code to View/Hide Status Bar in SDI and MDI Applications Owosso MI
- Code to View/Hide Status Bar in SDI and MDI Applications Petoskey MI
- Code to View/Hide Status Bar in SDI and MDI Applications Pinckney MI
- Code to View/Hide Status Bar in SDI and MDI Applications Plymouth MI
- Code to View/Hide Status Bar in SDI and MDI Applications Pontiac MI
- Code to View/Hide Status Bar in SDI and MDI Applications Port Huron MI
- Code to View/Hide Status Bar in SDI and MDI Applications Portage MI
- Code to View/Hide Status Bar in SDI and MDI Applications Redford MI
- Code to View/Hide Status Bar in SDI and MDI Applications Rochester MI
- Code to View/Hide Status Bar in SDI and MDI Applications Rockford MI
- Code to View/Hide Status Bar in SDI and MDI Applications Romulus MI
- Code to View/Hide Status Bar in SDI and MDI Applications Roseville MI
- Code to View/Hide Status Bar in SDI and MDI Applications Royal Oak MI
- Code to View/Hide Status Bar in SDI and MDI Applications Saginaw MI
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Clair Shores MI
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Johns MI
- Code to View/Hide Status Bar in SDI and MDI Applications Saline MI
- Code to View/Hide Status Bar in SDI and MDI Applications Sault Sainte Marie MI
- Code to View/Hide Status Bar in SDI and MDI Applications South Haven MI
- Code to View/Hide Status Bar in SDI and MDI Applications South Lyon MI
- Code to View/Hide Status Bar in SDI and MDI Applications Southfield MI
- Code to View/Hide Status Bar in SDI and MDI Applications Southgate MI
- Code to View/Hide Status Bar in SDI and MDI Applications Sterling Heights MI
- Code to View/Hide Status Bar in SDI and MDI Applications Sturgis MI
- Code to View/Hide Status Bar in SDI and MDI Applications Swartz Creek MI
- Code to View/Hide Status Bar in SDI and MDI Applications Taylor MI
- Code to View/Hide Status Bar in SDI and MDI Applications Temperance MI
- Code to View/Hide Status Bar in SDI and MDI Applications Three Rivers MI
- Code to View/Hide Status Bar in SDI and MDI Applications Traverse City MI
- Code to View/Hide Status Bar in SDI and MDI Applications Trenton MI
- Code to View/Hide Status Bar in SDI and MDI Applications Troy MI
- Code to View/Hide Status Bar in SDI and MDI Applications Utica MI
- Code to View/Hide Status Bar in SDI and MDI Applications Walled Lake MI
- Code to View/Hide Status Bar in SDI and MDI Applications Warren MI
- Code to View/Hide Status Bar in SDI and MDI Applications Waterford MI
- Code to View/Hide Status Bar in SDI and MDI Applications West Bloomfield MI
- Code to View/Hide Status Bar in SDI and MDI Applications Westland MI
- Code to View/Hide Status Bar in SDI and MDI Applications White Lake MI
- Code to View/Hide Status Bar in SDI and MDI Applications Wixom MI
- Code to View/Hide Status Bar in SDI and MDI Applications Wyandotte MI
- Code to View/Hide Status Bar in SDI and MDI Applications Wyoming MI
- Code to View/Hide Status Bar in SDI and MDI Applications Ypsilanti MI
- Code to View/Hide Status Bar in SDI and MDI Applications Zeeland MI
Related Local Events
Real-Time & Embedded Computing Conference-Detroit (RTECC)
Dates: 9/17/2009 - 9/17/2009
Location: Sterling Inn Banquet & Conference Center, Detroit
Sterling Heights, MI
View Details

A&WMA CONFERENCE & EXHIBITION
Dates: 6/16/2009 - 6/19/2009
Location: Marriott Hotel Detroit, Detroit
Detroit, MI
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