title: How to create a win32 application without window in background with C?
body: <p>The application do not need any window or console. It can be a console application if the console window can be removed or can be put into background. The application will do some simple tasks(such as cleaning rubbish files) and exit.</p>
  <ol>
  <li><p>I hope that the application should not be a windows service if possible.</p>
  </li>
  <li><p>I hope that the application can be started with double-click in explorer window and run silently.</p>
  </li>
  <li><p>When the application is running, I hope that the mouse cursor should not be changed to hourglass shape. That is to say, do not disturb the user when the application is running. Just run and exit silently.</p>
  </li>
  <li><p>DO NOT NEED to run it when windows starts or user logins.</p>
  </li>
  </ol>
  <p>I hope this can be done in C if possible.  What should I do?</p>
  <pre><code>task_finished = 0;
  CreateThread(NULL, 65535, task_thread, para, 0, NULL);
  
  MSG msg;
  while(!task_finished){
      while (PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE)) {
          if(task_finished)
              break;
          TranslateMessage(&amp;msg);
          DispatchMessage(&amp;msg);
      }
  }
  </code></pre>