Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 1.21 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. protected override void WndProc(ref Message m)
  2.         {
  3.             Thread.Sleep(100);
  4.            
  5.             switch(m.Msg) {
  6.                    
  7.                 case WMConstants.WM_SYSCOMMAND:
  8.                    
  9.                     if(m.WParam.ToInt32() == WMConstants.SC_MINIMIZE)
  10.                     {
  11.                         Hide();
  12.                         return;
  13.                     }
  14.                     else
  15.                     {
  16.                         break;
  17.                     }
  18.                    
  19.                 case WMConstants.WM_DEVICECHANGE:
  20.                    
  21.                     if(m.WParam.ToInt32() == WMConstants.DBT_DEVICEARRIVAL)
  22.                     {
  23.                         supportedDevicesManager.CheckForNewDevices();
  24.                         return;
  25.                     }
  26.                     else if(m.WParam.ToInt32() == WMConstants.DBT_DEVICEREMOVECOMPLETE)
  27.                     {
  28.                         supportedDevicesManager.CheckForRemovedDevices();
  29.                         return;
  30.                     }
  31.                     else
  32.                     {
  33.                         break;
  34.                     }
  35.                    
  36.             }
  37.             base.WndProc(ref m);
  38.            
  39.         }