void CExperHallServerDlg::OnUpdateViewMainWindow(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(IsWindowVisible());
if(ID_VIEW_MAIN_WINDOW==pCmdUI->m_nID)
pCmdUI->SetText("隐藏窗口");
}
为什么程序运行以后没有改变菜单的CAPTION项名字呢?
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(IsWindowVisible());
if(ID_VIEW_MAIN_WINDOW==pCmdUI->m_nID)
pCmdUI->SetText("隐藏窗口");
}
为什么程序运行以后没有改变菜单的CAPTION项名字呢?
解决方案 »
- 一个对话框弹出的对话框放在原对话框的右边,怎么实现?
- 关于获取动态链接库句柄的疑惑
- 请解读一下WinIo里的这段调用函数程序.
- 如何编程解压缩cab文件?
- CSocket如何实现多线程连接客户端
- 关于==【贴图】==的问题,请达人指点迷津
- x264 error LNK2019: unresolved external symbol _write_frame referenced in function _Decode
- VC6.0 怎样使我的程序支持 EUC-JP 正常显示。
- 初学者问题-怎样让RICHEDIT控件改变内容?
- 我想在程序中实现,如果xml文件不存在,程序生成一个空的xml文件,用c++语言dom好像没有提供生成xml文件的函数,我该怎么做?
- unresolved external symbol问题...
- 窗体滚动条,如何使之有效
#if !defined(AFX_CMDUIDIALOG_H__7D35F4B8_7531_11D1_8FA7_000000000000__INCLUDED_)
#define AFX_CMDUIDIALOG_H__7D35F4B8_7531_11D1_8FA7_000000000000__INCLUDED_#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// CmdUIDialog.h : header file
// /////////////////////////////////////////////////////////////////////////////
// CCmdUIDialog dialogclass CCmdUIDialog : public CDialog
{
// Construction
public:
CCmdUIDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL);
CCmdUIDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL);
CCmdUIDialog();
BOOL ContinueModal();// Implementation
protected: // Generated message map functions
//{{AFX_MSG(CCmdUIDialog)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.#endif // !defined(AFX_CMDUIDIALOG_H__7D35F4B8_7531_11D1_8FA7_000000000000__INCLUDED_)
类实现:
// CmdUIDialog.cpp : implementation file
//#include "stdafx.h"
#include "delme.h"
#include "CmdUIDialog.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CCmdUIDialog dialog
CCmdUIDialog::CCmdUIDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
: CDialog(lpszTemplateName, pParentWnd)
{
}CCmdUIDialog::CCmdUIDialog(UINT nIDTemplate, CWnd* pParentWnd)
: CDialog(nIDTemplate, pParentWnd)
{
}CCmdUIDialog::CCmdUIDialog()
{
}
BOOL CCmdUIDialog::ContinueModal()
{
// Iterate all child windows and instruct to update themselves
CWnd* pWndChild=GetWindow(GW_CHILD);
int iIndex=0;
while (NULL!=pWndChild)
{ CCmdUI state;
state.m_nID=::GetWindowLong(*pWndChild, GWL_ID);
state.m_nIndex=iIndex++;
state.m_pOther=pWndChild; // ***CCmdUI::DoUpdate is undocumented MFC***
state.DoUpdate(this, FALSE); pWndChild=pWndChild->GetWindow(GW_HWNDNEXT);
} // Must call the base class
return CDialog::ContinueModal();
}BEGIN_MESSAGE_MAP(CCmdUIDialog, CDialog)
//{{AFX_MSG_MAP(CCmdUIDialog)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CCmdUIDialog message handlers