title: error C3861: 'ShowWindow': identifier not found
body: <p>I am trying to write a simple CLR-Windows Form Application. It will show a window having a button. As soon as you click the button, it will hide one of the open Windows. To achieve this I am calling ShowWindow(00050214, false );, where 00050214 is the handle of the Window I am hiding. </p>
  
  <p>But it is giving error:</p>
  
  <pre><code>Error   1   error C3861: 'ShowWindow': identifier not found c:\users\afnan
  \documents     \visual studio 2010\projects\winformtest\winformtest\Form1.h 80
  </code></pre>
  
  <p>Please see the last lines of .h file given below, to see how I am using the above function. </p>
  
  <p><strong>WinformTest.cpp : main project file.</strong></p>
  
  <pre><code>#include "stdafx.h"
  #include "Form1.h"
  #include"windows.h"
  
  using namespace WinformTest;
  
  [STAThreadAttribute]
  int main(array&lt;System::String ^&gt; ^args)
  {
  // Enabling Windows XP visual effects before any controls are created
  Application::EnableVisualStyles();
  Application::SetCompatibleTextRenderingDefault(false); 
  
  // Create the main window and run it
  Application::Run(gcnew Form1());
  return 0;
  }
  </code></pre>
  
  <p><strong>Here is .h file</strong> </p>
  
  <pre><code>#pragma once
  
  namespace WinformTest {
  
  using namespace System;
  using namespace System::ComponentModel;
  using namespace System::Collections;
  using namespace System::Windows::Forms;
  using namespace System::Data;
  using namespace System::Drawing;
  
  /// &lt;summary&gt;
  /// Summary for Form1
  /// &lt;/summary&gt;
  public ref class Form1 : public System::Windows::Forms::Form
  {
  public:
      Form1(void)
      {
          InitializeComponent();
          //
          //TODO: Add the constructor code here
          //
      }
  
  protected:
      /// &lt;summary&gt;
      /// Clean up any resources being used.
      /// &lt;/summary&gt;
      ~Form1()
      {
          if (components)
          {
              delete components;
          }
      }
  private: System::Windows::Forms::Button^  button1;
  protected: 
  
  private:
      /// &lt;summary&gt;
      /// Required designer variable.
      /// &lt;/summary&gt;
      System::ComponentModel::Container ^components;
  
  #pragma region Windows Form Designer generated code
      /// &lt;summary&gt;
      /// Required method for Designer support - do not modify
      /// the contents of this method with the code editor.
      /// &lt;/summary&gt;
      void InitializeComponent(void)
      {
          this-&gt;button1 = (gcnew System::Windows::Forms::Button());
          this-&gt;SuspendLayout();
          // 
          // button1
          // 
          this-&gt;button1-&gt;Location = System::Drawing::Point(91, 51);
          this-&gt;button1-&gt;Name = L"button1";
          this-&gt;button1-&gt;Size = System::Drawing::Size(75, 23);
          this-&gt;button1-&gt;TabIndex = 0;
          this-&gt;button1-&gt;Text = L"button1";
          this-&gt;button1-&gt;UseVisualStyleBackColor = true;
          this-&gt;button1-&gt;Click += gcnew System::EventHandler(this,    
  &amp;Form1::button1_Click);
          // 
          // Form1
          // 
          this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);
          this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
          this-&gt;ClientSize = System::Drawing::Size(284, 262);
          this-&gt;Controls-&gt;Add(this-&gt;button1);
          this-&gt;Name = L"Form1";
          this-&gt;Text = L"Form1";
          this-&gt;ResumeLayout(false);
  
      }
  #pragma endregion
  private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  
               ShowWindow(00050214, false );
  
           }
  };
  }
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have now put windows.h in form.h file, and used ShowWindow((HWND)0x00050214, SW_HIDE);
   but now I am getting:  </p>
  
  <pre><code>Error   1   error LNK2028: unresolved token (0A000011) "extern "C" int __stdcall 
  ShowWindow(struct HWND__ *,int)" (?ShowWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function 
  "private: void __clrcall WinformTest::Form1::button1_Click(class System::Object ^,class 
  System::EventArgs ^)" 
  (?button1_Click@Form1@WinformTest@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)    
  C:\Users\Afnan\Documents\Visual Studio 2010\Projects\WinformTest\WinformTest\WinformTest.obj
  
  Error   2   error LNK2019: unresolved external symbol "extern "C" int __stdcall 
  ShowWindow(struct HWND__ *,int)" (?ShowWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function 
  "private: void __clrcall WinformTest::Form1::button1_Click(class System::Object ^,class 
  System::EventArgs ^)" 
  (?button1_Click@Form1@WinformTest@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)    
  C:\Users\Afnan\Documents\Visual Studio 2010\Projects\WinformTest\WinformTest\WinformTest.obj
  
  Error   3   error LNK1120: 2 unresolved externals   C:\Users\Afnan\Documents\Visual  
  Studio 2010\Projects\WinformTest\Debug\WinformTest.exe  1
  </code></pre>
  
  <p>How do put handle? I got this handle using spy++ tool. It also shows caption corresponding to the handle expressed in numbers. The corresponding handle in my case is:   <strong>WinformTest - Microsoft Visual Studio</strong></p>