上面说OnIdle函数是在消息从有到无的时候才发生!一般是用在什么地方?怎么用啊?

解决方案 »

  1.   

    BOOL CMyApp::OnIdle(LONG lCount)
    {
        BOOL bMore = CWinApp::OnIdle(lCount);    if (lCount == 0)
        {
        TRACE("App idle for short period of time\n");
        bMore = TRUE;
        }
        else if (lCount == 10)
        {
        TRACE("App idle for longer amount of time\n");
            bMore = TRUE;
        }
        else if (lCount == 100)
        {
            TRACE("App idle for even longer amount of time\n");
            bMore = TRUE;
        }
        else if (lCount == 1000)
        {
            TRACE("App idle for quite a long period of time\n");
         // bMore is not set to TRUE, no longer need idle
         // IMPORTANT: bMore is not set to FALSE since CWinApp::OnIdle may
         // have more idle tasks to complete.
        }    return bMore;
         // return TRUE as long as there is any more idle tasks
    }
      

  2.   

    又学习了i点,“这个函数一般不修改”
    ------ 谢谢  fanqing(火影忍者+26%)
      

  3.   

    给个例子程序吧:这些MSDN上都有,抄过来没意思.比方说,我在系统空闲时间内要执行三种过程,应该怎么写呢.