protected override void WndProc(ref Message m)
 {
     if (m.Msg == 0x0312 && m.WParam.ToInt32() == MYACTION_HOTKEYIN_ID)
     {
         if (MonitorM.Instance.client.Connected)
         {
             //save the current screen capture as selected
             MonitorM.setScreen(x, y, MousePosition.X, MousePosition.Y, new Size(x, y));
         }
         else
         {
             MessageBox.Show("Disconnected...Server has been stoped/closed by the other pc.");
         }
     }
     else if (m.Msg == 0x0312 && m.WParam.ToInt32() == MYACTION_HOTKEYOUT_ID)
     {
         if (MonitorM.Instance.client.Connected)
         {
             MonitorM.setDefaultScreen();
         }
         else
         {
             MessageBox.Show("Disconnected.....Server has been stoped/closed by the other pc.");
         }
     }
     base.WndProc(ref m);
 }
 private void Form1_keydown(object sender, KeyEventArgs e)
 {
     if (e.Control && e.KeyCode == Keys.F1)
     {
         if (MonitorM.Instance.client.Connected)
         {
             //save the current screen capture as selected
             MonitorM.setScreen(x, y, MousePosition.X, MousePosition.Y, new Size(x, y));
         }
         else
         {
             MessageBox.Show("Disconnected....Server has been stoped/closed by the other pc.");
         }
     }
     else if (e.Control && e.KeyCode == Keys.F2)
     {
         if (MonitorM.Instance.client.Connected)
         {
             MonitorM.setDefaultScreen();
         }
         else
         {
             MessageBox.Show("Disconnected....Server has been stoped/closed by the other pc.");
         }
     }
 }