title: The name 'WM_DEVICECHANGE' does not exist in the current context
body: <p>I am trying to detect a usb arrival event . I tried to override <code>wndproc()</code> for getting my messages. But I am facing an error by windows messages. </p>
  
  <p>The error is : </p>
  
  <pre><code>The name 'WM_DEVICECHANGE' does not exist in the current context
  
  The name 'DBT_DEVICEARRIVAL' does not exist in the current context
  </code></pre>
  
  <p>Also this is the code I am tried. </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  using System.Windows.Forms;         
  using System.IO;
  using Microsoft.Win32.SafeHandles; 
  
  namespace USBCheckerApp
  {
      public partial class Form1 : Form
      {
          bool bDeviceFound = false;
  
          public Form1()
          {
              InitializeComponent();
  
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
              if (!bDeviceFound)
              {
                  button1.Enabled = false;
              }
  
  
          }
          [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
          protected override void WndProc(ref Message m)
          {
              switch (m.Msg)
              {
                  case WM_DEVICECHANGE:
                      if (m.WParam == DBT_DEVICEARRIVAL)
                      {
                          MessageBox.Show("MEDIA FOUND");
                      }
              }
  
          }
  
      }
  }
  </code></pre>
  
  <p>Added so that you could suggest any updations in the same.
  Thanks</p>