title: C++ drawing pixels question
body: <p><br>
  How to make window, or more like clipping region , where I'll be able to draw pixels?
  It might use WinApi, however I don't want my project to look like winapi one, so it will have</p>
  
  <pre><code>int main(){}
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>int WINAPI WinMain(HINSTANCE ...
  </code></pre>
  
  <p>I have found an example, where I'm able to draw in console window</p>
  
  <pre><code>int main()
  {
      COLORREF color = RGB(255,0,0); // COLORREF to hold the color info
  
      SetConsoleTitle("Pixel In Console?"); // Set text of the console so you can find the window
  
      HWND hwnd = FindWindow(NULL, "Pixel In Console?"); // Get the HWND
      HDC hdc = GetDC(hwnd); // Get the DC from that HWND
  
      for( int i = 0 ; i &lt; 50 ; i++ )
      {
      SetPixel(hdc, 5+i, 12, color); // SetPixel(HDC hdc, int x, int y, COLORREF color)
      }
          ReleaseDC(hwnd, hdc); // Release the DC
      DeleteDC(hdc); // Delete the DC
      system("pause");
      return(0);
  }
  </code></pre>
  
  <p>but instead of console, I want to draw on my selected region, which will hold focus ( when user clicks on it, etc ).</p>
  
  <p>It would be also great to be able to handle simple keyboard/mouse events for this program, but it isn't my primary target here, maybe some other third party libraries will help with it.</p>
  
  <p>I hope I've explained clearly what I want to do, but English isn't my native language, so I'm very sorry for any missunderstandings. </p>
  
  <p>I will be thankfull for any help.  </p>
  
  <hr>
  
  <p>As I'm using this site first time, I'm sorry for little spam or messages in wrong places, as I'm not sure where to post my next messages :-)
  So what i wanted to write, is:</p>
  
  <p>"
  Otherwise, how does Allegro/SDL create window? They use assembler calls or shell ones? I'll be much happier, when I'll be able to create window from scratch, no matter how much work does it take :) 
  "</p>