//메시지 수신 처리 핸들러 void res_RecvKME(object sender, RecvKMEEventArgs e) { if (RecvedKME != null) { RecvedKME(this, e); } switch (e.MT) { case MsgType.MT_KDOWN: win32API.Key_Down(e.Key); break; case MsgType.MT_KUP: win32API.Key_Up(e.Key); break; case MsgType.MT_M_LDOWN: win32API.Mouse_LDown(); break; case MsgType.MT_M_LUP: win32API.Mouse_LUp(); break; case MsgType.MT_M_RDOWN: win32API.Mouse_RDown(); break; case MsgType.MT_M_RUP: win32API.Mouse_RUp(); break; case MsgType.MT_M_MDOWN: win32API.Mouse_MDown(); break; case MsgType.MT_M_MUP: win32API.Mouse_MUp(); break; case MsgType.MT_M_MOVE: win32API.Mouse_Move(e.Now.X, e.Now.Y); break; } }
void Receive(Socket dosock) { byte[] buff = new byte[9]; int n = dosock.Receive(buff); if (RecvKME != null) { RecvKMEEventArgs e = new RecvKMEEventArgs(new Meta(buff)); RecvKME(this, e); } dosock.Close(); }
void Remote_RecvedKME(object sender, RecvKMEEventArgs e) { if (this.InvokeRequired) { object[] objs = new object[2] { sender, e }; this.Invoke(new Recv_Dele(Remote_RecvedKME), objs); } else { if (e.MT == MsgType.MT_CLOSE) { this.Show(); vcf.Hide(); } } }
void GetInstance_RecvedKME(object sender, RecvKMEEventArgs e) { if (this.InvokeRequired) { object[] objs = new object[2] { sender, e }; this.Invoke(new Recv_Dele(GetInstance_RecvedKME), objs); } else { if (this.Visible) { if (e.MT == MsgType.MT_M_MOVE) { this.Location = new Point(e.Now.X + 3, e.Now.Y + 3); } } } }