title: Why setTimer is not working?
body: <p>I have below program. I would like to know how <code>setTimer</code> works. So, I wrote a program but could not able to understand why TimerProc function not getting called. Why? What else need to be done to fire setTimer/TimerProc. Please help.</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  
  VOID CALLBACK TimerProc(
      HWND hwnd,  // handle of window for timer messages 
      UINT uMsg,  // WM_TIMER message
      UINT idEvent,   // timer identifier
      DWORD dwTime    // current system time
     ) {
        printf("from callback\n");
  
     }
  int main(int argc, char *argv[])
  {
     UINT timerid = SetTimer(NULL,1,1000,TimerProc);/*changed the time from 1 to 1000, but no effect*/
     printf("timerid %d\n",timerid); 
     int i,j;
  
        //delay loop, waiting for the callback function to be called
     for(j=0;j&lt;0xffffffff;j++);
     /*{
     printf("%d\n", j);
     }*/
  
     printf("done \n");
    system("PAUSE");  
    return 0;
  }
  </code></pre>