title: Replacing WinMain() with main() function in Win32 programs
body: <p>I searched a little bit on StackOverflow and Google but couldn't get the idea. I want to start my application with this type of user programming:</p>
  
  <pre><code>int main()
  {
    Window App("Test", 640, 480);
  
    while(App.IsOpen())
    {
      // Do the stuff
    }
  }
  </code></pre>
  
  <p>But this isn't possible because I should pass the <code>hInstance</code> and <code>hPrevInstance</code> and other parameters to a <code>WinMain</code> function. Actually there is a Window class which I designed to make the window creation a little bit easier. I saw this implementation on SFML but I don't know how it did come to this.</p>
  
  <p>Right now I'm using the usual way:</p>
  
  <pre><code>int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR, int)
  {
    Window App(hInst, hPrevInst, "Test", 640, 480);
  
    while(App.IsOpen())
    {
      // Do the stuff
    }
  }
  </code></pre>
  
  <p>Thanks.</p>