c++怎么弹出消息框?

2025-03-13 09:22:09
推荐回答(5个)
回答1:

IDE:VC6
WIN32控制台程序
#include //为MessageBox,system函数提供原型声明
int main(void)
{
MessageBox(NULL,TEXT("HELLO WORLD!"),TEXT("MSG"),MB_OK);
system("pause");
return 0;
}
如果是MFC的可以直接使用MessageBox,AFXMessageBox,具体看MSDN吧,你要的是哪种?

回答2:

Windows平台可以使用MessageBox函数,如
MessageBox(NULL,"MessageBoxText(内容)","Title(标题)",MB_OK);

回答3:

AfxMessageBox
"stdafx.h"

回答4:

#include int WINAPI WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, TEXT ("asdfgasdgas"),
TEXT ("xiaoxi"),
0) ;
return 0 ;
}

回答5:

MFC下可以使用 AfxMessageBox(_T("something"))