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

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

Anyware Mobile Solutions
918-280-8693
5800 E Skelly DR
Tulsa, OK
Amercian Education Corporation
405-840-6031
7506 Broadway Ext
Oklahoma City, OK
Earnest Computer Service
405-732-1233
7005 SE 15th St
Oklahoma City, OK
Axis Integrated Solutions
918-488-1881
2818 E 81st Pl
Tulsa, OK
Dreyer Software Inc
918-838-7638
PO Box 3391
Tulsa, OK
Software Etc
918-254-9124
Woodland Hills Mall
Tulsa, OK
Tah Software Systems
405-478-3962
3400 NE 115th St
Oklahoma City, OK
Midwest CAM Solutions (GibbsCAM)
763-560-6567
NOW SERVING: OKLAHOMA
Oklahoma City, OK
Griffey & Associates
918-627-6399
5350 E 46th Street Suite 145
Tulsa, OK
B Solutions LLC
918-749-9200
5645 S Madison Ave
Tulsa, OK

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

Anyware Mobile Solutions

918-280-8693
5800 E Skelly DR
Tulsa, OK

Related Articles
- Visual Basic .NET Attributes Oklahoma
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.
- JavaBean Proxies Oklahoma
- Interacting with .NET WinForms, Part 1 Oklahoma
- Placing Logo on the Top DockBar of the Frame Window Oklahoma
- ListBox with Grayed Out / Non-Selectable Items Oklahoma
- Advanced C++/CLI Oklahoma
- Extending CPictureHolder for loading BMP, JPG, etc. Oklahoma
- Enumerate NT services Oklahoma
- Avoiding Boolean Overload Oklahoma
- Audio Mixer Control Classes Oklahoma
Regional Articles
- Code to View/Hide Status Bar in SDI and MDI Applications Ada OK
- Code to View/Hide Status Bar in SDI and MDI Applications Altus OK
- Code to View/Hide Status Bar in SDI and MDI Applications Ardmore OK
- Code to View/Hide Status Bar in SDI and MDI Applications Bartlesville OK
- Code to View/Hide Status Bar in SDI and MDI Applications Bethany OK
- Code to View/Hide Status Bar in SDI and MDI Applications Bixby OK
- Code to View/Hide Status Bar in SDI and MDI Applications Broken Arrow OK
- Code to View/Hide Status Bar in SDI and MDI Applications Chickasha OK
- Code to View/Hide Status Bar in SDI and MDI Applications Choctaw OK
- Code to View/Hide Status Bar in SDI and MDI Applications Claremore OK
- Code to View/Hide Status Bar in SDI and MDI Applications Duncan OK
- Code to View/Hide Status Bar in SDI and MDI Applications Durant OK
- Code to View/Hide Status Bar in SDI and MDI Applications Edmond OK
- Code to View/Hide Status Bar in SDI and MDI Applications El Reno OK
- Code to View/Hide Status Bar in SDI and MDI Applications Enid OK
- Code to View/Hide Status Bar in SDI and MDI Applications Guthrie OK
- Code to View/Hide Status Bar in SDI and MDI Applications Lawton OK
- Code to View/Hide Status Bar in SDI and MDI Applications Mcalester OK
- Code to View/Hide Status Bar in SDI and MDI Applications Muskogee OK
- Code to View/Hide Status Bar in SDI and MDI Applications Mustang OK
- Code to View/Hide Status Bar in SDI and MDI Applications Norman OK
- Code to View/Hide Status Bar in SDI and MDI Applications Oklahoma City OK
- Code to View/Hide Status Bar in SDI and MDI Applications Okmulgee OK
- Code to View/Hide Status Bar in SDI and MDI Applications Owasso OK
- Code to View/Hide Status Bar in SDI and MDI Applications Ponca City OK
- Code to View/Hide Status Bar in SDI and MDI Applications Pryor OK
- Code to View/Hide Status Bar in SDI and MDI Applications Sand Springs OK
- Code to View/Hide Status Bar in SDI and MDI Applications Sapulpa OK
- Code to View/Hide Status Bar in SDI and MDI Applications Shawnee OK
- Code to View/Hide Status Bar in SDI and MDI Applications Stillwater OK
- Code to View/Hide Status Bar in SDI and MDI Applications Tahlequah OK
- Code to View/Hide Status Bar in SDI and MDI Applications Tulsa OK
- Code to View/Hide Status Bar in SDI and MDI Applications Woodward OK
- Code to View/Hide Status Bar in SDI and MDI Applications Yukon OK

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