Thanks. I was actually already on that path when I posted the message just didn't know how to implement the RegisterDeviceNotification() function properly. doing this allowed me to be able to capture the messages I wanted but I now need an explanation on something else.
Everytime I dock/undock my windows phone I get my message but the default is also triggered twice.
Code:
protected override void WndProc(ref Message m)
{
// Listen for operating system messages.
switch (m.Msg)
{
case (int)DeviceEvents.deviceEvent:
{
switch ( m.WParam.ToInt32() )
{
case (int)DeviceEvents.deviceAdded:
MessageBox.Show("A device has been docked");
break;
case (int)DeviceEvents.deviceRemoved:
MessageBox.Show("A device has been REMOVED");
break;
default:
MessageBox.Show("unrequired system Message was:\n\t" + m.WParam.ToString());
break;
} //end of nested switch statement
}
break;
}
base.WndProc(ref m);
}//end wndProc