public static List <API.RECT> GetTaskbarLocations() { if (API.hTaskBars.Count == 0) { return(new List <API.RECT>()); } List <API.RECT> list = new List <API.RECT>(); foreach (IntPtr current in API.hTaskBars) { API.RECT item = default(API.RECT); API.GetWindowRect(current, out item); list.Add(item); } return(list); }
private static extern bool GetWindowRect(IntPtr hwnd, out API.RECT lpRect);