title: 'GetConsoleWindow' was not declared in this scope?
body: <p><code>#include&lt;windows.h&gt;</code> have already added, so why the GCC-mingw32 Compiler reported that <code>'GetConsoleWindow' was not declared in this scope</code> ?</p>
  
  <p>Here's my code: </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cmath&gt;
  #include&lt;windows.h&gt;
  
  using namespace std;
  
  #define PI 3.14
  
  int main() 
  {
      //Get a console handle
      HWND myconsole = GetConsoleWindow();
      //Get a handle to device context
      HDC mydc = GetDC(myconsole);
  
      int pixel =0;
  
      //Choose any color
      COLORREF COLOR= RGB(255,255,255); 
  
      //Draw pixels
      for(double i = 0; i &lt; PI * 4; i += 0.05)
      {
          SetPixel(mydc,pixel,(int)(50+25*cos(i)),COLOR);
          pixel+=1;
      }
  
      ReleaseDC(myconsole, mydc);
      cin.ignore();
      return 0;
  }
  </code></pre>
  
  <p>Thanks. ^^</p>