16,470
社区成员
发帖
与我相关
我的任务
分享
// MFCStatusBar.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
UINT g_nIndicator[] = {
ID_SEPARATOR,
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_OVR
};
class CStatusBarFrame : public CFrameWnd
{
DECLARE_MESSAGE_MAP()
public:
afx_msg int OnCreate( LPCREATESTRUCT lpCreateStruct );
public:
CStatusBar m_wndStatusBar;
};
BEGIN_MESSAGE_MAP( CStatusBarFrame, CFrameWnd )
ON_WM_CREATE( )
END_MESSAGE_MAP( )
int CStatusBarFrame::OnCreate( LPCREATESTRUCT lpCreateStruct )
{
CFrameWnd::OnCreate( lpCreateStruct );
m_wndStatusBar.Create( this );
m_wndStatusBar.SetIndicators(g_nIndicator,sizeof(g_nIndicator)/sizeof(UINT));
return 1;
}
class CStatusBarApp : public CWinApp
{
public:
virtual BOOL InitInstance( );
};
CStatusBarApp theApp;
BOOL CStatusBarApp::InitInstance( )
{
CStatusBarFrame * pWnd = new CStatusBarFrame();
pWnd->Create( NULL, "StatusBar" );
m_pMainWnd = pWnd;
m_pMainWnd->ShowWindow( SW_SHOW );
m_pMainWnd->UpdateWindow( );
return TRUE;
}