private void GridForm_Load(object sender, EventArgs e) { this.pnlMain.VerticalScroll.Visible = false; this.nfyGrid.Visible = true; this.caption.MouseDown += new MouseEventHandler(GridForm_MouseDown); this.pnlMain.MouseDown += new MouseEventHandler(GridForm_MouseDown); int pWnd = DeskTopEntry.FindWindow("Progman", null); //int pWnd2 = DeskTopEntry.FindWindowEx((IntPtr)pWnd, IntPtr.Zero, "SHELLDLL_DefVIew", null);//查找受限 //int pWnd3 = DeskTopEntry.FindWindowEx((IntPtr)pWnd2, IntPtr.Zero, "SysListView32", null);//查找受限 //int pWnd4 = DeskTopEntry.FindWindow("SysListView32", null);//查不到结果 DeskTopEntry.SetParent(this.Handle.ToInt32(), (int)DesktopHandle.Progman); //Rectangle ScreenArea = Screen.GetWorkingArea(this); this.WindowState = FormWindowState.Minimized; this.WindowState = FormWindowState.Normal; //获取窗口标题 //IntPtr handle = this.Handle; //StringBuilder sbTit = new StringBuilder(256); //int it = DeskTopEntry.GetWindowText(handle, sbTit, sbTit.Capacity); ////获取窗口类名 //StringBuilder sbCls = new StringBuilder(256); //int ic = DeskTopEntry.GetClassName(handle, sbCls, sbCls.Capacity); }
private void GridForm_MouseDown(object sender, MouseEventArgs e) { DeskTopEntry.ReleaseCapture(); DeskTopEntry.SendMessage(this.Handle, DeskTopEntry.WM_SYSCOMMAND, DeskTopEntry.SC_MOVE + DeskTopEntry.HTCAPTION, 0); }