/// <summary>
        /// <para>
        ///     Requests a size and screen position for an appbar. When the request is made, the message proposes a
        ///     screen edge and a bounding rectangle for the appbar.
        /// </para>
        /// <para>
        ///     The system adjusts the bounding rectangle so
        ///     that the appbar does not interfere with the Windows taskbar or any other appbars.
        /// </para>
        /// </summary>
        public void QueryPosition(ref Position position, DockPosition dock)
        {
            //TODO:

            //ABM_QUERYPOS seems to do nothing on Windows 10. It gives back the exact
            //same dimensions, not adjusting for the start bar

            //When the dock is docked to the left for example, it doesn't take the
            //entire screen length because the start bar is there. I used ABM_QUERYPOS
            //to tell me how much space Windows actually assigned to to the dock

            //Since ABM_QUERYPOS doesn't work properly on Windows 10, I've decided
            //to only allow the screen to be reserved when docked to top of the screen,
            //with the assumption that the start bar is always on the botton of the screen

            //The code is being left "as is" in case I figure out the solution to it

            APPBARDATA msgData = new APPBARDATA();

            msgData.cbSize = Marshal.SizeOf(msgData);
            msgData.hWnd   = _handle;
            msgData.uEdge  = (uint)dock.ToNative();
            position.ToNative(ref msgData.rc);

            Win32AppBar.SHAppBarMessage(ABM.ABM_QUERYPOS, ref msgData);
            position = Position.FromNative(ref msgData.rc);
        }
        /// <summary>
        /// Retrieves the handle to the appbar associated to the edge of the screen.
        /// </summary>
        /// <returns>
        /// Returns the handle to the autohide appbar. The return value is 0 if an error occurs or
        /// if no autohide appbar is associated with the given edge.
        /// </returns>
        public IntPtr GetAutoHide(DockPosition dock)
        {
            APPBARDATA msgData = new APPBARDATA();

            msgData.cbSize = Marshal.SizeOf(msgData);
            msgData.hWnd   = _handle;
            msgData.uEdge  = (uint)dock.ToNative();

            return(Win32AppBar.SHAppBarMessage(ABM.ABM_GETAUTOHIDEBAR, ref msgData));
        }
        /// <summary>
        /// Registers or unregisters an autohide appbar for an edge of the screen.
        /// </summary>
        /// <returns>
        /// Returns true if successful, or false if an error occurs or
        /// if an autohide appbar is already registered for the given edge.
        /// </returns>
        public bool SetAutoHide(DockPosition dock, bool autohide)
        {
            APPBARDATA msgData = new APPBARDATA();

            msgData.cbSize = Marshal.SizeOf(msgData);
            msgData.hWnd   = _handle;
            msgData.lParam = autohide ? Win32.TRUE : Win32.FALSE;
            msgData.uEdge  = (uint)dock.ToNative();

            return(Win32AppBar.SHAppBarMessage(ABM.ABM_SETAUTOHIDEBAR, ref msgData).ToInt32() == Win32.TRUE);
        }
        /// <summary>
        /// <para>
        ///     Sets the size and screen position of an appbar. The message specifies a
        ///     screen edge and the bounding rectangle for the appbar.
        /// </para>
        /// <para>
        ///     The system may adjust the bounding rectangle so that the appbar does not
        ///     interfere with the Windows taskbar or any other appbars.
        /// </para>
        /// </summary>
        public void SetPosition(ref Position position, DockPosition dock)
        {
            APPBARDATA msgData = new APPBARDATA();

            msgData.cbSize = Marshal.SizeOf(msgData);
            msgData.hWnd   = _handle;
            msgData.uEdge  = (uint)dock.ToNative();
            position.ToNative(ref msgData.rc);

            if (dock.Selected == DockEdge.Top)
            {
                msgData.rc.bottom = msgData.rc.bottom + 8;
            }

            Win32AppBar.SHAppBarMessage(ABM.ABM_SETPOS, ref msgData);
            position = Position.FromNative(ref msgData.rc);
        }