C++ messagebox语法

1.MessageBox(NULL,"内容","标题",MB_OK)

#include <windows.h>
using namespace std;
int main()
{
    MessageBox(NULL,"contents","title",MB_OK);
}

2.MessageBox(NULL,"内容","标题",MB_OK|ICONWARNING)

#include <windows.h>
using namespace std;
int main()
{
    MessageBox(NULL,"contents","title",MB_OK|ICONWARNING);
}

3.MessageBox(NULL,"内容","标题",MB_OK|ICONQUESTION)

#include <windows.h>
using namespace std;
int main()
{
    int response=MessageBox(NULL,"contents","title",MB_OK|ICONWARNING);
    if (response==IDYES)
    {
        cout<<yes;
    }
    else
    {
        cout<<no;
    }
}

猜你喜欢

转载自blog.csdn.net/hzxhxyj1/article/details/131432443