示例#1
0
        public static DockStyle GetTaskbarEdge()
        {
            IntPtr taskBarWnd = Windowing.FindWindow("Shell_TrayWnd", null);

            Windowing.APPBARDATA abd = new Windowing.APPBARDATA();
            abd.hWnd = taskBarWnd;
            Windowing.SHAppBarMessage(Windowing.ABM_GETTASKBARPOS, ref abd);

            if (abd.rc.Top == abd.rc.Left && abd.rc.Bottom > abd.rc.Right)
            {
                return(DockStyle.Left);
            }
            else if (abd.rc.Top == abd.rc.Left && abd.rc.Bottom < abd.rc.Right)
            {
                return(DockStyle.Top);
            }
            else if (abd.rc.Top > abd.rc.Left)
            {
                return(DockStyle.Bottom);
            }
            else
            {
                return(DockStyle.Right);
            }
        }
示例#2
0
        public static DockStyle GetTaskbarEdge()
        {
            IntPtr taskBarWnd = Windowing.FindWindow("Shell_TrayWnd", null);

            Windowing.APPBARDATA abd = new Windowing.APPBARDATA();
            abd.hWnd = taskBarWnd;
            Windowing.SHAppBarMessage(Windowing.ABM_GETTASKBARPOS, ref abd);

            if (abd.rc.Top == abd.rc.Left && abd.rc.Bottom > abd.rc.Right)
            {
                return DockStyle.Left;
            }
            else if (abd.rc.Top == abd.rc.Left && abd.rc.Bottom < abd.rc.Right)
            {
                return DockStyle.Top;
            }
            else if (abd.rc.Top > abd.rc.Left)
            {
                return DockStyle.Bottom;
            }
            else
            {
                return DockStyle.Right;
            }
        }