Ejemplo n.º 1
0
 /// <summary>处理Rdp控件的一些消息</summary>
 private int WinRdpClientProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam)
 {
     if (msg == 15)
     {
         User32.CallWindowProc(_oldRdpClientWinProc, hwnd, msg, wParam, lParam);
         Graphics grap = Graphics.FromHwnd(hwnd);
         grap.Clear(Color.White);
         return(0);
     }
     if (msg == 20)
     {
         Graphics grap = Graphics.FromHwnd(hwnd);
         grap.Clear(Color.White);
         return(0);
     }
     if (msg == 133)
     {
         User32.CallWindowProc(_oldRdpClientWinProc, hwnd, msg, wParam, lParam);
         return(0);
     }
     if (msg == 512)//WM_MOUSEMOVE
     {
         int num = lParam.ToInt32();
         MouseMoveProc?.Invoke(CommonServices.LOWORD(num), CommonServices.HIWORD(num));
     }
     return(User32.CallWindowProc(_oldRdpClientWinProc, hwnd, msg, wParam, lParam));
 }
Ejemplo n.º 2
0
 /// <summary>键盘鼠标输入框窗口的消息处理</summary>
 private int WinInRdpClientProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam)
 {
     if (msg == 512)//WM_MOUSEMOVE
     {
         int num = lParam.ToInt32();
         User32.GetWindowRect(hwnd, out var chileRect);
         User32.GetWindowRect(_topWindowHwnd, out var parentRect);
         int x = chileRect.Left - parentRect.Left;
         int y = chileRect.Top - parentRect.Top;
         MouseMoveProc?.Invoke(CommonServices.LOWORD(num) + x, CommonServices.HIWORD(num) + y);
     }
     if (msg == 513)//WM_LBUTTONDOWN
     {
         User32.SetFocus(hwnd);
     }
     return(User32.CallWindowProc(_oldInRdpClientWinProc, hwnd, msg, wParam, lParam));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 鼠标移动
 /// </summary>
 private void MouseMove_Event(int wParam, int lParam)
 {
     MouseMoveProc?.Invoke(wParam, lParam);
 }