public void GetPosition(string strClassName, string strWindowName) { m_data = new APPBARDATA(); m_data.cbSize = Marshal.SizeOf(typeof(APPBARDATA)); var hWnd = WinApi.FindWindow(strClassName, strWindowName); if (hWnd != IntPtr.Zero && WinApi.SHAppBarMessage(WinApi.ABM_GETTASKBARPOS, ref m_data) != 1) throw new Exception("Failed to communicate with the given AppBar"); }
internal static extern UInt32 SHAppBarMessage(uint dwMessage, ref APPBARDATA data);