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

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

Epicor Software
502-339-7748
8700 Westport RD
Louisville, KY
Global Software
859-264-9215
501 Darby Creek RD
Lexington, KY
Api
859-233-2006
167 W Main St
Lexington, KY
Business Technology Solutions
859-977-3829
1450 N Broadway
Lexington, KY
Dynamic Accounting Solutions
859-858-3598
2375 Glass Mill RD
Lexington, KY
Onsite Solutions Corp
859-255-0545
271 W Short St
Lexington, KY
National Innovative Software Solutions LLC
502-495-0548
2108 Plantside DR
Louisville, KY
Epicor Software Corporation
502-412-7666
9100 Shelbyville RD
Louisville, KY
Information Systems Solutions Inc
502-245-7003
12730 Townepark Way
Louisville, KY
Halo Group, Inc.
502-657-6468
9900 Corporate Campus Drive
Louisville, KY

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

Epicor Software

502-339-7748
8700 Westport RD
Louisville, KY

Related Articles
- Visual Basic .NET Attributes Kentucky
Attributes are classes that allow individual developers to extend VS.NET tools without rebuilding VS.NET each time. Many attributes are already available, but most of the interesting ones haven't even been written yet. Perhaps you will do so.
- Audio Mixer Control Classes Kentucky
- Interacting with .NET WinForms, Part 1 Kentucky
- Placing Logo on the Top DockBar of the Frame Window Kentucky
- JavaBean Proxies Kentucky
- Avoiding Boolean Overload Kentucky
- ListBox with Grayed Out / Non-Selectable Items Kentucky
- Advanced C++/CLI Kentucky
- Enumerate NT services Kentucky
- Extending CPictureHolder for loading BMP, JPG, etc. Kentucky
Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Ashland KY
- Code to View/Hide Status Bar in SDI and MDI Applications Bardstown KY
- Code to View/Hide Status Bar in SDI and MDI Applications Bowling Green KY
- Code to View/Hide Status Bar in SDI and MDI Applications Campbellsville KY
- Code to View/Hide Status Bar in SDI and MDI Applications Corbin KY
- Code to View/Hide Status Bar in SDI and MDI Applications Covington KY
- Code to View/Hide Status Bar in SDI and MDI Applications Crestwood KY
- Code to View/Hide Status Bar in SDI and MDI Applications Cynthiana KY
- Code to View/Hide Status Bar in SDI and MDI Applications Elizabethtown KY
- Code to View/Hide Status Bar in SDI and MDI Applications Erlanger KY
- Code to View/Hide Status Bar in SDI and MDI Applications Florence KY
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Campbell KY
- Code to View/Hide Status Bar in SDI and MDI Applications Fort Thomas KY
- Code to View/Hide Status Bar in SDI and MDI Applications Frankfort KY
- Code to View/Hide Status Bar in SDI and MDI Applications Ft Mitchell KY
- Code to View/Hide Status Bar in SDI and MDI Applications Georgetown KY
- Code to View/Hide Status Bar in SDI and MDI Applications Glasgow KY
- Code to View/Hide Status Bar in SDI and MDI Applications Harrodsburg KY
- Code to View/Hide Status Bar in SDI and MDI Applications Hazard KY
- Code to View/Hide Status Bar in SDI and MDI Applications Henderson KY
- Code to View/Hide Status Bar in SDI and MDI Applications Hopkinsville KY
- Code to View/Hide Status Bar in SDI and MDI Applications Latonia KY
- Code to View/Hide Status Bar in SDI and MDI Applications Leitchfield KY
- Code to View/Hide Status Bar in SDI and MDI Applications Lexington KY
- Code to View/Hide Status Bar in SDI and MDI Applications London KY
- Code to View/Hide Status Bar in SDI and MDI Applications Louisville KY
- Code to View/Hide Status Bar in SDI and MDI Applications Madisonville KY
- Code to View/Hide Status Bar in SDI and MDI Applications Mayfield KY
- Code to View/Hide Status Bar in SDI and MDI Applications Morehead KY
- Code to View/Hide Status Bar in SDI and MDI Applications Mount Sterling KY
- Code to View/Hide Status Bar in SDI and MDI Applications Murray KY
- Code to View/Hide Status Bar in SDI and MDI Applications Newport KY
- Code to View/Hide Status Bar in SDI and MDI Applications Nicholasville KY
- Code to View/Hide Status Bar in SDI and MDI Applications Owensboro KY
- Code to View/Hide Status Bar in SDI and MDI Applications Paducah KY
- Code to View/Hide Status Bar in SDI and MDI Applications Pikeville KY
- Code to View/Hide Status Bar in SDI and MDI Applications Radcliff KY
- Code to View/Hide Status Bar in SDI and MDI Applications Richmond KY
- Code to View/Hide Status Bar in SDI and MDI Applications Scottsville KY
- Code to View/Hide Status Bar in SDI and MDI Applications Shepherdsville KY
- Code to View/Hide Status Bar in SDI and MDI Applications Somerset KY
- Code to View/Hide Status Bar in SDI and MDI Applications Versailles KY
- Code to View/Hide Status Bar in SDI and MDI Applications Winchester KY
Related Articles
- Advanced C++/CLI Kentucky
C++/CLI has a number of advanced features that make developing and maintaining applications easier. Discover how these allow types to be moved between assemblies without breaking existing application, allow fast and efficient interoperability between native functions, and make it possible to create functions that take a variable number of parameters while still maintaining type safety.
- Avoiding Boolean Overload Kentucky
- Visual Basic .NET Attributes Kentucky
- Extending CPictureHolder for loading BMP, JPG, etc. Kentucky
- Placing Logo on the Top DockBar of the Frame Window Kentucky
- ListBox with Grayed Out / Non-Selectable Items Kentucky
- Enumerate NT services Kentucky
- Audio Mixer Control Classes Kentucky
- JavaBean Proxies Kentucky
- Interacting with .NET WinForms, Part 1 Kentucky
Related Local Event
SUR/FIN - Annual Technical Conference and Exhibit of Surface Finishing
Dates: 6/16/2009 - 6/18/2009
Location: Kentucky International Convention Center
Louisville, KY
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