AfxMessageBox与MessageBox的区别
2009-06-03 16:35
211 查看
int AfxMessageBox(
LPCTSTR lpszText,
UINT nType = MB_OK,
UINT nIDHelp = 0 );
lpszText Points to a CString object or null-terminated string containing the message to be displayed in the message box. nType The style of the message box. Apply any of the message-box styles to the box. nIDHelp The Help-context ID for the message; 0 indicates the application’s default Help context will be used.
int MessageBox(
HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType);
hWnd [in] Handle to the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window. lpText [in] Long pointer to a null-terminated string that contains the message to be displayed. lpCaption [in] Long pointer to a null-terminated string used for the dialog box title. If this parameter is NULL, the default title “Error” is used. uType [in] Specifies a set of bit flags that determine the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.
1.MessageBox是CWnd的类成员函数。
AfxMessageBox是全局API函数。
2.如果使用的是MFC应用程序,两者都可以使用,但用AfxMessageBox更方便。
如果创建的是SDK,则只能用MessageBox。
AfxMessageBox是AFX小组为了取代API采取的一种方法。
3.MessageBox比AfxMessageBox灵活,体现在参数上。因为AfxMessageBox是一个全局函数所以不需要对应一个窗类,同时也不能控制消息框的标题。而MessageBox可以通过参数写明标题内容。
LPCTSTR lpszText,
UINT nType = MB_OK,
UINT nIDHelp = 0 );
lpszText Points to a CString object or null-terminated string containing the message to be displayed in the message box. nType The style of the message box. Apply any of the message-box styles to the box. nIDHelp The Help-context ID for the message; 0 indicates the application’s default Help context will be used.
int MessageBox(
HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType);
hWnd [in] Handle to the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window. lpText [in] Long pointer to a null-terminated string that contains the message to be displayed. lpCaption [in] Long pointer to a null-terminated string used for the dialog box title. If this parameter is NULL, the default title “Error” is used. uType [in] Specifies a set of bit flags that determine the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.
1.MessageBox是CWnd的类成员函数。
AfxMessageBox是全局API函数。
2.如果使用的是MFC应用程序,两者都可以使用,但用AfxMessageBox更方便。
如果创建的是SDK,则只能用MessageBox。
AfxMessageBox是AFX小组为了取代API采取的一种方法。
3.MessageBox比AfxMessageBox灵活,体现在参数上。因为AfxMessageBox是一个全局函数所以不需要对应一个窗类,同时也不能控制消息框的标题。而MessageBox可以通过参数写明标题内容。
相关文章推荐
- AfxMessageBox与MessageBox的区别:
- AfxMessageBox和MessageBox区别
- MessageBox、:: MessageBox、AfxMessageBox三者区别
- AfxMessageBox和MessageBox有什么区别
- MessageBox()与AfxMessageBox()的区别
- AfxMessageBox()和MessageBox()区别 详解
- AfxMessageBox和MessageBox区别
- AfxMessageBox和MessageBox区别
- MessageBox、::MessageBox 、AfxMessageBox三者的区别
- AfxMessageBox与MessageBox的区别
- VC中MessageBox与AfxMessageBox用法与区别
- MFC中AfxMessageBox和MessageBox的区别
- AfxMessageBox和MessageBox区别
- VC 中 AfxmessageBox和MessageBox区别
- AfxMessageBox与MessageBox的区别
- MessageBox显示变量及与AfxMessageBox区别
- AfxMessageBox与MessageBox的区别
- AfxMessageBox和MessageBox的区别
- VC中MessageBox与AfxMessageBox用法与区别
- AfxMessageBox()与MessageBox()的区别