Ejemplo n.º 1
0
        public void GetPosition(string strClassName, string strWindowName)
        {
            m_data        = new APPBARDATA();
            m_data.cbSize = (uint)Marshal.SizeOf(m_data.GetType());

            if (FindWindow(strClassName, strWindowName) == IntPtr.Zero)
            {
                throw new Exception("Failed to find an AppBar that matched the given criteria");
            }

            if (SHAppBarMessage(ABM_GETTASKBARPOS, ref m_data) != 1)
            {
                throw new Exception("Failed to communicate with the given AppBar");
            }
        }
Ejemplo n.º 2
0
        public void GetPosition(string strClassName, string strWindowName)
        {
            m_data        = new APPBARDATA();
            m_data.cbSize = (UInt32)Marshal.SizeOf(m_data.GetType());

            IntPtr hWnd = FindWindow(strClassName, strWindowName);

            if (hWnd != IntPtr.Zero)
            {
                UInt32 uResult = SHAppBarMessage(ABM_GETTASKBARPOS, ref m_data);

                if (uResult != 1)
                {
                    //throw new Exception("Failed to communicate with the given AppBar");
                }
            }
            else
            {
                //throw new Exception("Failed to find an AppBar that matched the given criteria");
            }
        }
        public void GetPosition(string strClassName, string strWindowName)
        {
            m_data = new APPBARDATA();
            m_data.cbSize = (UInt32) Marshal.SizeOf(m_data.GetType());

            IntPtr hWnd = FindWindow(strClassName, strWindowName);

            if (hWnd != IntPtr.Zero)
            {
                UInt32 uResult = SHAppBarMessage(ABM_GETTASKBARPOS, ref m_data);

                if (uResult != 1)
                {
                    throw new Exception("Failed to communicate with the given AppBar");
                }
            }
            else
            {
                throw new Exception("Failed to find an AppBar that matched the given criteria");
            }
        }