如题.
  比如程序启动之后,控制显示时间,然后消失 怎么实现/

解决方案 »

  1.   

    比较简单的方法,在对话框的OnInitDialog中SetTimer,在OnTimer中OnOK
      

  2.   

    初始SetTimer(1,10000,NULL)
    在ONTIMER中,killtimer()
      

  3.   

    CreateWaitableTimer怎么使用?
    设置定时器倒是挺好,要想实现在对话框上显示倒计时 就更好了
      

  4.   

    #include <windows.h>
    #include <stdio.h>int main()
    {
        HANDLE hTimer = NULL;
        LARGE_INTEGER liDueTime;    liDueTime.QuadPart=-100000000;    // Create a waitable timer.
        hTimer = CreateWaitableTimer(NULL, TRUE, "WaitableTimer");
        if (!hTimer)
        {
            printf("CreateWaitableTimer failed (%d)\n", GetLastError());
            return 1;
        }    printf("Waiting for 10 seconds...\n");    // Set a timer to wait for 10 seconds.
        if (!SetWaitableTimer(
            hTimer, &liDueTime, 0, NULL, NULL, 0))
        {
            printf("SetWaitableTimer failed (%d)\n", GetLastError());
            return 2;
        }    // Wait for the timer.    if (WaitForSingleObject(hTimer, INFINITE) != WAIT_OBJECT_0)
            printf("WaitForSingleObject failed (%d)\n", GetLastError());
        else 
            printf("Timer was signaled.\n");    return 0;
    }
      

  5.   

    #include <windows.h>
    #include <stdio.h>int main()
    {
        HANDLE hTimer = NULL;
        LARGE_INTEGER liDueTime;    liDueTime.QuadPart=-100000000;    // Create a waitable timer.
        hTimer = CreateWaitableTimer(NULL, TRUE, "WaitableTimer");
        if (!hTimer)
        {
            printf("CreateWaitableTimer failed (%d)\n", GetLastError());
            return 1;
        }    printf("Waiting for 10 seconds...\n");    // Set a timer to wait for 10 seconds.
        if (!SetWaitableTimer(
            hTimer, &liDueTime, 0, NULL, NULL, 0))
        {
            printf("SetWaitableTimer failed (%d)\n", GetLastError());
            return 2;
        }    // Wait for the timer.    if (WaitForSingleObject(hTimer, INFINITE) != WAIT_OBJECT_0)
            printf("WaitForSingleObject failed (%d)\n", GetLastError());
        else printf("Timer was signaled.\n");    return 0;
    }
      

  6.   

    #include <windows.h>
    #include <stdio.h>int main()
    {
        HANDLE hTimer = NULL;
        LARGE_INTEGER liDueTime;    liDueTime.QuadPart=-100000000;    // Create a waitable timer.
        hTimer = CreateWaitableTimer(NULL, TRUE, "WaitableTimer");
        if (!hTimer)
        {
            printf("CreateWaitableTimer failed (%d)\n", GetLastError());
            return 1;
        }    printf("Waiting for 10 seconds...\n");    // Set a timer to wait for 10 seconds.
        if (!SetWaitableTimer(
            hTimer, &liDueTime, 0, NULL, NULL, 0))
        {
            printf("SetWaitableTimer failed (%d)\n", GetLastError());
            return 2;
        }    // Wait for the timer.    if (WaitForSingleObject(hTimer, INFINITE) != WAIT_OBJECT_0)
            printf("WaitForSingleObject failed (%d)\n", GetLastError());
        else printf("Timer was signaled.\n");    return 0;
    }
      

  7.   

    使用定时器
    SetTimer
    OnTimer里计时,判断
      

  8.   

    倒记时简单啊,首先用一个Timer吧,时间用秒做基本单位,设定多久触发一次,时间然后递减,显示的时候把秒转换一下,到0就KillTimer(),OnCancel(),
      

  9.   

    CSplashScreen* splash;
    splash = new CSplashScreen;
    splash->Create(CSplashScreen::IDD);
    splash->SetIcon(hIcon,FALSE);
    splash->SetWindowText("整定系统");
    splash->ShowWindow(SW_SHOW);
    splash->UpdateWindow();
    Sleep(3000);
    splash->ShowWindow(SW_HIDE);
    splash->DestroyWindow();
    delete splash;
      

  10.   

    程序中任何想控制已知精确时间都可以如此实现;如果要停留的时间不知道,则可以将sleep函数改为你想在对话框显示期间执行的操作。如果要倒计时,则需要在对话框上用timer实现。