57 BOOL result = SubclassWindow(hStatusBar);
65 SetPanes(nPanes, 3,
false);
74 UINT window_style = WS_CHILD | WS_VISIBLE ;
75 window_style |= style_flags;
77 m_ProgressBar.Create(m_hWnd, rect, NULL, window_style, 0, ProgressBarCtlID);
130 std::basic_string<TCHAR> text = _T(
"");
139 TCHAR* chars =
new TCHAR[l];
141 for (
int i = 0; i < l; i++)
142 chars[i] = TCHAR(
'\0');
144 GetText(pane_index, chars, NULL);
151 BOOL result = SetText(pane_index, text.c_str(), flags);
221 LRESULT CStatusBarPlus::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
225 LRESULT res = CMultiPaneStatusBarCtrl::OnSize(uMsg, wParam, lParam, bHandled);
CStatusBarPlus() noexcept
int GetProgressBarPane() const
Default : 2.
void SetProgressBarPane(int pane_index)
Select the pane to contain the embedded CProgressBarCtrl.
int GetTextLength(CString str, HFONT font)
Measure the length, in pixels, of a string using a given font.
CProgressBarCtrl m_ProgressBar
virtual BOOL SubclassStatusBar(HWND hFrameWnd, UINT ProgressBarCtlID, UINT style_flags=0)
SubclassStatusBar subclasses a pre-existing status bar and creates a default 3 panes with a progress ...
virtual ~CStatusBarPlus()
BOOL SetPaneStyle(int pane_index, UINT flags)
Valid style flags are 0 (sunken - no longer works on Win10), SBT_NOBORDERS, SBT_OWNERDRAW, SBT_POPOUT, SBT_RTLREADING and SBT_NOTABPARSING. Specify only one per pane; see the MSDN documentation for the SB_SETTEXT message for more detail.
CProgressBarCtrl & ProgressBar()
Returns a reference to the embedded CProgressBarCtrl.
virtual void UnSubclassStatusBar()
Release the status bar and destroy the embedded progress bar control.
int GetProgressBarMargin() const
Default : 2.
void SetProgressBarMargin(int margin)
Defines the margin around the embedded CProgressBarCtrl, within the pane client area. Make sure not to make this value too big.