⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statusbarex.cpp

📁 VC源代码大全(精华版)
💻 CPP
字号:
// StatusBarEx.cpp : implementation file
//

#include "stdafx.h"
#include "Explorer.h"
#include "StatusBarEx.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CStatusBarEx

CStatusBarEx::CStatusBarEx()
{
	m_nId = 0;
	m_nStyle = 0;
	m_cxWidth = 0;
	m_strStatusText = _T("");
}

CStatusBarEx::~CStatusBarEx()
{
}


BEGIN_MESSAGE_MAP(CStatusBarEx, CStatusBar)
	//{{AFX_MSG_MAP(CStatusBarEx)
	//}}AFX_MSG_MAP
	ON_MESSAGE(WM_SETTEXT, OnSetText)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CStatusBarEx message handlers

LRESULT CStatusBarEx::OnSetText(WPARAM wParam, LPARAM lParam)
{
char	*Message;
	Message = (char *) lParam;
	if (Message == NULL)
		return (0);

	if (m_nId == 0)
	{
		GetPaneInfo (1, m_nId, m_nStyle, m_cxWidth);
	}
	switch (wParam)
	{
		case ID_INDICATOR_DEFAULT:
			CStatusBar::SetPaneText (1, _T(Message), TRUE);
//			CStatusBar::SetPaneText (0, _T(""), TRUE);
			m_strStatusText = _T(Message);
			break;
		default:
			if (!strcmp (Message, "Ready"))
			{
				CStatusBar::SetPaneText (0, _T(""), TRUE);
				GetPaneInfo (0, m_nWinId, m_nWinStyle, m_cxWinWidth);
				SetPaneInfo (0, 0, SBPS_POPOUT, 0);
				SetPaneInfo (1, m_nId, SBPS_STRETCH, m_cxWidth);
				SetPaneText (1, (LPCSTR) m_strStatusText, TRUE);
				break;
			}
			CStatusBar::SetPaneText (0, _T(Message), TRUE);
			SetPaneInfo (1, m_nId, SBPS_POPOUT, 0);
			SetPaneInfo (0, m_nWinId, SBPS_POPOUT | SBPS_STRETCH, m_cxWidth);
//			SetPaneInfo (1, m_nId, SBPS_NORMAL, 0);
//			SetPaneInfo (0, m_nWinId, SBPS_NORMAL | SBPS_STRETCH, m_cxWidth);
			SetPaneText (1, _T(""), TRUE);
			break;
	}
	return (0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -