예제 #1
0
파일: PinForm.cs 프로젝트: tesys25/pinwin
        /// <summary>
        ///  Resets pinned icon location relative to parent when parent is moved.
        /// </summary>
        public void MoveToParentWindow()
        {
            Point newLocation = PinForm.GetRelativeLocation(this._parentHandle);

            this.Left = newLocation.X;
            this.Top  = newLocation.Y;
        }
예제 #2
0
파일: PinForm.cs 프로젝트: tesys25/pinwin
        /// <summary>
        ///  Calculates absolute location of pin icon based on parent form's handle.
        /// </summary>
        /// <param name="handle">Parent window handle.</param>
        /// <returns>Absolute location of pin icon.</returns>
        private static Point GetRelativeLocation(IntPtr handle)
        {
            int       rightMargin = PinForm.GetControlAreaWidth(handle) + 20;
            Rectangle move        = ApiWindowPos.Get(handle);

            return(new Point(move.Left + move.Width - rightMargin, move.Top + 5));
        }
예제 #3
0
파일: PinForm.cs 프로젝트: tesys25/pinwin
        public static PinForm Create(IntPtr parentHandle)
        {
            PinForm pinForm = new PinForm(parentHandle);

            ApiTopMost.Set(parentHandle);
            PinForm.ShowSetOwnerHandle(pinForm, parentHandle);
            return(pinForm);
        }