title: How do I correctly set the entry point for an exe in Visual Studio?
body: <p>I have set the entry point to WinMain but when I run the app it starts and doesn't display, I then have to shut it with task manager. Here's the code upto WinMain() :</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  
  // forward declarations
  LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); 
  
  // The entry point into a windows program
  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int windowStyle )
  {
  ....
  </code></pre>
  
  <p>I'm not experienced in C++, and I don't know what this is doing, except making my exe smaller, which is what I'm trying to achieve.</p>
  
  <p>edit : What I'm trying to do is create a very small window exe to understand how demo coder's work. So I'm thinking of creating a small c++ window app that provides a window handle to which I can attach SlimDX (if i can statically link the final c++ dll to a C# app, but I'm not there yet) I have my BasicWindow.exe down to 6,656 bytes. So I'm experimenting with anything I can find to get that size down to &lt;3k.</p>
  
  <p>[2012.Jan.10] Well I've had some success by rebuilding minicrt (available from <a href="http://www.benshoof.org/blog/small-programs/" rel="noreferrer">http://www.benshoof.org/blog/small-programs/</a>) under VS2010 and adding it as an additional dependency. I couldn't Ignore All Default Libraries as suggested, but I now have a Windowed application with an exe size of 4,096 bytes. I'd say that's some significant success. I'm within striking distance now. Every reduction from here on in, is more room for SlimDX. I'm pretty happy considering the only c++ apps I've ever written are console apps and a basic window :) I've been lucky I know !</p>