MessageBOX函数有几个参数,分别作用是什么?
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/06/28 09:36:57
MessageBOX函数有几个参数,分别作用是什么?
![MessageBOX函数有几个参数,分别作用是什么?](/uploads/image/z/19047502-46-2.jpg?t=MessageBOX%E5%87%BD%E6%95%B0%E6%9C%89%E5%87%A0%E4%B8%AA%E5%8F%82%E6%95%B0%2C%E5%88%86%E5%88%AB%E4%BD%9C%E7%94%A8%E6%98%AF%E4%BB%80%E4%B9%88%3F)
MFC的MessageBox封装在CWnd类中,原型
int CWnd::MessageBox( LPCTSTR lpszText,LPCTSTR lpszCaption = NULL,UINT nType = MB_OK );
只有一个必须的参数lpszText.
你自己写的MessageBox默认调用Win32 API,原型
int MessageBox(
HWND hWnd,// handle to owner window
LPCTSTR lpText,// text in message box
LPCTSTR lpCaption,// message box title
UINT uType // message box style
);
需要四个参数.
int CWnd::MessageBox( LPCTSTR lpszText,LPCTSTR lpszCaption = NULL,UINT nType = MB_OK );
只有一个必须的参数lpszText.
你自己写的MessageBox默认调用Win32 API,原型
int MessageBox(
HWND hWnd,// handle to owner window
LPCTSTR lpText,// text in message box
LPCTSTR lpCaption,// message box title
UINT uType // message box style
);
需要四个参数.