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

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

Windows data recovery software
001-9811111111
Road
City, UT
Windows data recovery software
001-9811111111
Road
City, UT
freeware undelete
980-000-0000
Street
Town, UT
freeware undelete
980-000-0000
Street
Town, UT
Herman Street, Inc.
801-528-4159
2425 Lincoln Ave
Ogden, UT
Jon Sult
801-654-7943
1464 Capitol
Ogden, UT
Aha!Logic
(801) 705-9357
1055 East 100 South
Lindon, UT
DigiCert, Inc
(801) 701-9600
355 E. 520 W. Canopy Bldg
Lindon, UT
I.M. Flash Technologies
(801) 767-3965
1550 East 3400 North
Lehi, UT
Wasatch Software
888-275-8850
5093 West 6275 South
West Jordan, UT

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

Windows data recovery software

Data restoration utility rescue lost or missing MP3, MP4, MPEG file format audio video music files.

001-9811111111
Road
City, UT
http://www.techddi.com

Data recovery software restores lost pictures, audio songs and text document files.

http://www.techddi.com
http://www.techddi.com

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications American Fork UT
- Code to View/Hide Status Bar in SDI and MDI Applications Bountiful UT
- Code to View/Hide Status Bar in SDI and MDI Applications Brigham City UT
- Code to View/Hide Status Bar in SDI and MDI Applications Cedar City UT
- Code to View/Hide Status Bar in SDI and MDI Applications Centerville UT
- Code to View/Hide Status Bar in SDI and MDI Applications Clearfield UT
- Code to View/Hide Status Bar in SDI and MDI Applications Draper UT
- Code to View/Hide Status Bar in SDI and MDI Applications Kaysville UT
- Code to View/Hide Status Bar in SDI and MDI Applications Layton UT
- Code to View/Hide Status Bar in SDI and MDI Applications Lehi UT
- Code to View/Hide Status Bar in SDI and MDI Applications Logan UT
- Code to View/Hide Status Bar in SDI and MDI Applications Magna UT
- Code to View/Hide Status Bar in SDI and MDI Applications Midvale UT
- Code to View/Hide Status Bar in SDI and MDI Applications Ogden UT
- Code to View/Hide Status Bar in SDI and MDI Applications Orem UT
- Code to View/Hide Status Bar in SDI and MDI Applications Park City UT
- Code to View/Hide Status Bar in SDI and MDI Applications Pleasant Grove UT
- Code to View/Hide Status Bar in SDI and MDI Applications Provo UT
- Code to View/Hide Status Bar in SDI and MDI Applications Riverton UT
- Code to View/Hide Status Bar in SDI and MDI Applications Roy UT
- Code to View/Hide Status Bar in SDI and MDI Applications Saint George UT
- Code to View/Hide Status Bar in SDI and MDI Applications Salt Lake City UT
- Code to View/Hide Status Bar in SDI and MDI Applications Sandy UT
- Code to View/Hide Status Bar in SDI and MDI Applications South Jordan UT
- Code to View/Hide Status Bar in SDI and MDI Applications Spanish Fork UT
- Code to View/Hide Status Bar in SDI and MDI Applications Springville UT
- Code to View/Hide Status Bar in SDI and MDI Applications Tooele UT
- Code to View/Hide Status Bar in SDI and MDI Applications Vernal UT
- Code to View/Hide Status Bar in SDI and MDI Applications West Jordan UT
Related Local Event
Conference on Information Technology (CIT)
Dates: 10/19/2009 - 10/22/2008
Location: Salt Palace Convention Center
Salt Lake City, UT
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