Exemple #1
0
 /// <summary>
 /// 开始拖动窗口
 /// </summary>
 /// <param name="hWnd">窗口句柄</param>
 public static void BeginDrag(IntPtr hWnd)
 {
     UnsafeNativeMethods.ReleaseCapture();
     UnsafeNativeMethods.SendMessage(hWnd, NativeMethods.WM_SYSCOMMAND, NativeMethods.SC_MOVE | NativeMethods.HTCAPTION, 0);
 }
Exemple #2
0
        /// <summary>
        /// 在指定句柄窗口内弹起鼠标,等待消息处理完成后再返回
        /// </summary>
        /// <param name="hWnd">窗口句柄</param>
        /// <param name="pt">相对于窗口的点</param>
        public static void SendMouseUp(IntPtr hWnd, Point pt)
        {
            IntPtr lParam = Util.MAKELPARAM(pt.X, pt.Y);

            UnsafeNativeMethods.SendMessage(hWnd, NativeMethods.WM_LBUTTONUP, IntPtr.Zero, lParam);
        }
Exemple #3
0
 /// <summary>
 /// 开始更新,允许控件重绘
 /// </summary>
 /// <param name="hWnd">控件句柄</param>
 public static void EndUpdate(IntPtr hWnd)
 {
     UnsafeNativeMethods.SendMessage(hWnd, NativeMethods.WM_SETREDRAW, 1, 0);
 }