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

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

Quasar Software Inc
504-485-5606
710 Weiblen Pl
New Orleans, LA
Electronic Evidence Retrival LLC
504-483-0201
718 N Alexander St
New Orleans, LA
VanillaSoft, Inc.
866-763-8826
1820 St. Charles Ave.
New Orleans, LA
Ecad Inc
504-818-3091
824 Elmwood Park Blvd
New Orleans, LA
CMA Technology Solutions
225-927-9200
8180 YMCA Plaza DR
Baton Rouge, LA
Creative Computer Solutions
225-925-3210
1651 Thibodeaux Ave
Baton Rouge, LA
Custom Accounting Solutions Inc
225-935-2202
2974 Fritchie Dr
Baton Rouge, LA
Network Solution Providers
225-709-2591
5515 Superior Dr
Baton Rouge, LA
Bits Technical Corp
225-752-8899
14141 Airline Hwy
Baton Rouge, LA
Cyrious Software
225-752-2867
12627 Jefferson Hwy
Baton Rouge, LA

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

Quasar Software Inc

504-485-5606
710 Weiblen Pl
New Orleans, LA

Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Abbeville LA
- Code to View/Hide Status Bar in SDI and MDI Applications Alexandria LA
- Code to View/Hide Status Bar in SDI and MDI Applications Baker LA
- Code to View/Hide Status Bar in SDI and MDI Applications Bastrop LA
- Code to View/Hide Status Bar in SDI and MDI Applications Baton Rouge LA
- Code to View/Hide Status Bar in SDI and MDI Applications Bogalusa LA
- Code to View/Hide Status Bar in SDI and MDI Applications Bossier City LA
- Code to View/Hide Status Bar in SDI and MDI Applications Breaux Bridge LA
- Code to View/Hide Status Bar in SDI and MDI Applications Carencro LA
- Code to View/Hide Status Bar in SDI and MDI Applications Chalmette LA
- Code to View/Hide Status Bar in SDI and MDI Applications Covington LA
- Code to View/Hide Status Bar in SDI and MDI Applications Crowley LA
- Code to View/Hide Status Bar in SDI and MDI Applications Denham Springs LA
- Code to View/Hide Status Bar in SDI and MDI Applications Deridder LA
- Code to View/Hide Status Bar in SDI and MDI Applications Eunice LA
- Code to View/Hide Status Bar in SDI and MDI Applications Franklinton LA
- Code to View/Hide Status Bar in SDI and MDI Applications Gonzales LA
- Code to View/Hide Status Bar in SDI and MDI Applications Gretna LA
- Code to View/Hide Status Bar in SDI and MDI Applications Hammond LA
- Code to View/Hide Status Bar in SDI and MDI Applications Harvey LA
- Code to View/Hide Status Bar in SDI and MDI Applications Haughton LA
- Code to View/Hide Status Bar in SDI and MDI Applications Houma LA
- Code to View/Hide Status Bar in SDI and MDI Applications Jennings LA
- Code to View/Hide Status Bar in SDI and MDI Applications Kenner LA
- Code to View/Hide Status Bar in SDI and MDI Applications La Place LA
- Code to View/Hide Status Bar in SDI and MDI Applications Lafayette LA
- Code to View/Hide Status Bar in SDI and MDI Applications Lake Charles LA
- Code to View/Hide Status Bar in SDI and MDI Applications Leesville LA
- Code to View/Hide Status Bar in SDI and MDI Applications Mandeville LA
- Code to View/Hide Status Bar in SDI and MDI Applications Marrero LA
- Code to View/Hide Status Bar in SDI and MDI Applications Metairie LA
- Code to View/Hide Status Bar in SDI and MDI Applications Minden LA
- Code to View/Hide Status Bar in SDI and MDI Applications Monroe LA
- Code to View/Hide Status Bar in SDI and MDI Applications Morgan City LA
- Code to View/Hide Status Bar in SDI and MDI Applications Natchitoches LA
- Code to View/Hide Status Bar in SDI and MDI Applications New Iberia LA
- Code to View/Hide Status Bar in SDI and MDI Applications New Orleans LA
- Code to View/Hide Status Bar in SDI and MDI Applications Opelousas LA
- Code to View/Hide Status Bar in SDI and MDI Applications Pineville LA
- Code to View/Hide Status Bar in SDI and MDI Applications Plaquemine LA
- Code to View/Hide Status Bar in SDI and MDI Applications Ponchatoula LA
- Code to View/Hide Status Bar in SDI and MDI Applications Prairieville LA
- Code to View/Hide Status Bar in SDI and MDI Applications Rayne LA
- Code to View/Hide Status Bar in SDI and MDI Applications Ruston LA
- Code to View/Hide Status Bar in SDI and MDI Applications Saint Martinville LA
- Code to View/Hide Status Bar in SDI and MDI Applications Shreveport LA
- Code to View/Hide Status Bar in SDI and MDI Applications Slidell LA
- Code to View/Hide Status Bar in SDI and MDI Applications Sulphur LA
- Code to View/Hide Status Bar in SDI and MDI Applications Thibodaux LA
- Code to View/Hide Status Bar in SDI and MDI Applications Ville Platte LA
- Code to View/Hide Status Bar in SDI and MDI Applications Walker LA
- Code to View/Hide Status Bar in SDI and MDI Applications West Monroe LA
- Code to View/Hide Status Bar in SDI and MDI Applications Westwego LA
- Code to View/Hide Status Bar in SDI and MDI Applications Zachary LA
Related Local Event
Annual Technical Conference & Exhibition (ATCE 2009)
Dates: 10/4/2009 - 10/7/2009
Location: Ernest N Morial Convention Center, New Orleans
New Orleans, LA
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