Created
August 1, 2011 17:59
-
-
Save jaranflaath/1118644 to your computer and use it in GitHub Desktop.
WndProc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void WndProc(ref Message m) | |
{ | |
Thread.Sleep(100); | |
switch(m.Msg) { | |
case WMConstants.WM_SYSCOMMAND: | |
if(m.WParam.ToInt32() == WMConstants.SC_MINIMIZE) | |
{ | |
Hide(); | |
return; | |
} | |
else | |
{ | |
break; | |
} | |
case WMConstants.WM_DEVICECHANGE: | |
if(m.WParam.ToInt32() == WMConstants.DBT_DEVICEARRIVAL) | |
{ | |
supportedDevicesManager.CheckForNewDevices(); | |
return; | |
} | |
else if(m.WParam.ToInt32() == WMConstants.DBT_DEVICEREMOVECOMPLETE) | |
{ | |
supportedDevicesManager.CheckForRemovedDevices(); | |
return; | |
} | |
else | |
{ | |
break; | |
} | |
} | |
base.WndProc(ref m); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment