您的位置:首页 > 其它

MessageBoxA多线程-2

2016-03-14 00:58 316 查看
#include <iostream>

#include <thread>

#include <windows.h>

#include <vector>

using namespace std;

using namespace std::this_thread;

void msg()

{

    MessageBoxA(0, "12345", "678910", 0);

}

void main()

{

    vector<thread *> threads;

    for (int i = 0; i < 10;i++)

    {

        threads.push_back(new thread(msg));//创建一个线程

    }

    for (auto th: threads)

    {

        th->join();

    }

    system("pause");

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: