谢谢。

解决方案 »

  1.   

    你可以为不同的Timer设置不同的TIMERPROC,
    但你也可以把这个设置为NULL,
    而在WM_TIMER中用Case来处理。
      

  2.   

    你可以为不同的Timer设置不同的TIMERPROC,这时每一个定时器都有自己的处理函数,case没有必要。你也可以把这个设置为NULL,而在WM_TIMER中用Case来处理,这时所有的定时器共一个处理函数,要用case看看当前是那个定时器事件要处理
      

  3.   

    // Set the timer. 
     
    SetTimer(hwnd,                // handle to main window 
        IDT_TIMER3,               // timer identifier 
        5000,                     // 5-second interval 
        (TIMERPROC) MyTimerProc); // timer callback 
    The calling convention for MyTimerProc must be based on the TimerProc callback function. TimerProc的定义:VOID CALLBACK TimerProc(
      HWND hwnd,         // handle to window
      UINT uMsg,         // WM_TIMER message
      UINT_PTR idEvent,  // timer identifier
      DWORD dwTime       // current system time
    );具体查看MSDN SetTimer(),一般把TimerProc设置为NULL