MutiFunctionDialog
所属分类:对话框与窗口
开发工具:Visual C++
文件大小:31KB
下载次数:5
上传日期:2007-01-26 18:10:11
上 传 者:
xhl123
说明: 一个实现多功能对话框的程序,比较好懂,很适合初学者。
(a multi-purpose dialog procedures, better understand and are very suitable for beginners.)
文件列表:
实例 23--多功能对话框\resource.h (1326, 2003-04-05)
实例 23--多功能对话框\STDAFX.CPP (205, 2003-04-05)
实例 23--多功能对话框\STDAFX.H (975, 2003-04-05)
实例 23--多功能对话框\Wzd.aps (39428, 2003-04-05)
实例 23--多功能对话框\WZD.CPP (2024, 2003-04-05)
实例 23--多功能对话框\WZD.H (1291, 2003-04-05)
实例 23--多功能对话框\Wzd.rc (8309, 2003-04-05)
实例 23--多功能对话框\Wzd5.001 (4067, 2003-04-05)
实例 23--多功能对话框\Wzd5.002 (4067, 2003-04-05)
实例 23--多功能对话框\Wzd5.dsp (4182, 2003-04-05)
实例 23--多功能对话框\Wzd5.dsw (532, 2003-04-05)
实例 23--多功能对话框\Wzd5.ncb (50176, 2003-04-05)
实例 23--多功能对话框\Wzd5.opt (49664, 2003-04-05)
实例 23--多功能对话框\Wzd5.plg (667, 2003-04-05)
实例 23--多功能对话框\WZD6.DSP (4105, 2003-04-05)
实例 23--多功能对话框\WZD6.DSW (530, 2003-04-05)
实例 23--多功能对话框\WZDDLG.CPP (5406, 2003-04-05)
实例 23--多功能对话框\WZDDLG.H (1422, 2003-04-05)
实例 23--多功能对话框\_desktop.ini (9, 2006-12-03)
实例 23--多功能对话框\WIZARD\_desktop.ini (9, 2006-12-03)
实例 23--多功能对话框\RES\Toolbar.bmp (1078, 2003-04-05)
实例 23--多功能对话框\RES\WZD.ICO (1078, 2003-04-05)
实例 23--多功能对话框\RES\WZD.RC2 (395, 2003-04-05)
实例 23--多功能对话框\RES\_desktop.ini (9, 2006-12-03)
实例 23--多功能对话框\WIZARD (0, 2007-01-26)
实例 23--多功能对话框\RES (0, 2007-01-26)
实例 23--多功能对话框 (0, 2007-01-26)
/////////////////////////////////////////////////////////////////////
// To Add a Menu...
/////////////////////////////////////////////////////////////////////
// 1) Use the Menu Editor to create a new menu, or copy one from another
// project.
//
// 2) Use the Dialog Editor to add this menu to your dialog app's template.
//
// 3) Use the ClassWizard to add command handlers to your dialog class.
/////////////////////////////////////////////////////////////////////
// To Add a Toolbar...
/////////////////////////////////////////////////////////////////////
// 1) Use the Toolbar Editor to create a new toolbar, or copy one from another
// project.
//
// 2) Use the Dialog Editor to add a long skinny static control where you'd like
// the toolbar to go in your dialog template.
//
// 3) Embed a CToolbar class variable in your dialog class:
CToolbar m_wndToolBar;
// 4) In the dialog class's OnInitDialog() message handler, create the toolbar
// and position it inside the static control:
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
// move toolbar and status bar over static controls
CRect rect;
GetDlgItem(IDC_TOOLBAR_STATIC)->GetWindowRect(&rect);
ScreenToClient(&rect);
m_wndToolBar.MoveWindow(&rect);
// 5) You must also manually update the status of these toolbars (gray them out, etc.)
/////////////////////////////////////////////////////////////////////
// To Add a Status Bar...
/////////////////////////////////////////////////////////////////////
// 1) Use the String Table Editor to define your status bar panes:
ID_INDICATOR_ONE "xxx"
ID_INDICATOR_TWO "yyy"
// 2) Use the Dialog Editor to add a static control where you want your status
// bar to appear in your dialog template.
// 3) Embed a status bar control in your dialog class:
CStatusBar m_wndStatusBar;
// 4) Add a list of status pane definitions to the top of your dialog class:
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_ONE,
ID_INDICATOR_TWO,
};
// 5) Create the status bar and position it over the static control:
if (!m_wndStatusBar.Create(this,WS_CHILD|WS_VISIBLE|WS_BORDER) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
GetDlgItem(IDC_STATUSBAR_STATIC)->GetWindowRect(&rect);
ScreenToClient(&rect);
m_wndStatusBar.MoveWindow(&rect);
// 6) Indent the first status bar pane so that it shows:
UINT nID,nStyle;
int nWidth;
m_wndStatusBar.GetPaneInfo(0, nID, nStyle, nWidth) ;
m_wndStatusBar.SetPaneInfo(0, nID, SBPS_STRETCH, nWidth) ;
// 7) You must now manually update the status panes in this bar.
/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1999 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////
近期下载者:
相关文件:
收藏者: