summaryrefslogtreecommitdiff
path: root/onlineupdate/workben/test_dialog.cxx
blob: 113ec07eebbd2eb2d56925743f96c1b521178eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "progressui.h"
#include "progressui_win.cxx"

#include <thread>
#include <chrono>
#include <iostream>

void func()
{
    for (int i = 0; i <= 100; ++i)
    {
        std::this_thread::sleep_for(std::chrono::milliseconds(200));
        UpdateProgressUI(i);
    }
    QuitProgressUI();
}

int wmain(int argc, wchar_t** argv)
{
    InitProgressUI(&argc, &argv);
    std::thread a(func);
    /*
    volatile bool b = false;
    do
    {
        std::this_thread::sleep_for(std::chrono::seconds(1));
    }
    while (!b);
    */
    int result = ShowProgressUI();
    std::cout << result << std::endl;
    a.join();
    return 0;
}