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); } }
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; } }