StatusBar.cpp
资源名称:Netmanag.zip [点击查看]
上传用户:geanq888
上传日期:2007-01-03
资源大小:316k
文件大小:2k
源码类别:
Ftp客户端
开发平台:
Visual C++
- // This is a part of the Microsoft Foundation Classes C++ library.
- // Copyright (C) 1992-1997 Microsoft Corporation
- // All rights reserved.
- //
- // This source code is only intended as a supplement to the
- // Microsoft Foundation Classes Reference and related
- // electronic documentation provided with the library.
- // See these sources for detailed information regarding the
- // Microsoft Foundation Classes product.
- #include "stdafx.h"
- #include <afxpriv.h>
- #include "statusbar.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDlgStatusBar
- BEGIN_MESSAGE_MAP(CDlgStatusBar, CStatusBar)
- //{{AFX_MSG_MAP(CDlgStatusBar)
- ON_MESSAGE(WM_IDLEUPDATECMDUI, OnIdleUpdateCmdUI)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDlgStatusBar Construction/Destruction
- CDlgStatusBar::CDlgStatusBar()
- {
- }
- CDlgStatusBar::~CDlgStatusBar()
- {
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDlgStatusBar::OnIdleUpdateCmdUI
- // OnIdleUpdateCmdUI handles the WM_IDLEUPDATECMDUI message, which is
- // used to update the status of user-interface elements within the MFC
- // framework.
- //
- // We have to get a little tricky here: CStatusBar::OnUpdateCmdUI
- // expects a CFrameWnd pointer as its first parameter. However, it
- // doesn't do anything but pass the parameter on to another function
- // which only requires a CCmdTarget pointer. We can get a CWnd pointer
- // to the parent window, which is a CCmdTarget, but may not be a
- // CFrameWnd. So, to make CStatusBar::OnUpdateCmdUI happy, we will call
- // our CWnd pointer a CFrameWnd pointer temporarily.
- LRESULT CDlgStatusBar::OnIdleUpdateCmdUI(WPARAM wParam, LPARAM)
- {
- if (IsWindowVisible())
- {
- CFrameWnd *pParent = (CFrameWnd *)GetParent();
- if (pParent)
- OnUpdateCmdUI(pParent, (BOOL)wParam);
- }
- return 0L;
- }