RT隐藏窗口标题栏后,自己写了个伪标题栏。
但是出现了一个问题,
就是鼠标按住标题栏拖动窗口的时候,会将标题栏拖到windows任务栏背面,松开后就找不到窗口了
不知道怎么解决???鼠标任务栏拖动标题栏判断位置

解决方案 »

  1.   

            [DllImport("user32.dll", EntryPoint = "GetWindowRect")]
            private static extern bool GetWindowRect(IntPtr hWnd, ref Rectangle lpRect);        [DllImport("user32.dll")]
            public static extern IntPtr FindWindow(string strClassName, int nptWindowName);         private void MainForm_LocationChanged(object sender, EventArgs e)
            {
                IntPtr hWnd = FindWindow("Shell_TrayWnd", 0);            if (hWnd != IntPtr.Zero)
                {
                    Rectangle rect = new Rectangle();
                    GetWindowRect(hWnd, ref rect);                if (this.Top >= rect.Top)
                    {
                        this.Top = rect.Top + this.Height;
                    }
                }
            }