ShowWindow() private method

private ShowWindow ( IntPtr hWnd, short cmdShow ) : int
hWnd System.IntPtr
cmdShow short
return int
コード例 #1
0
        /// <summary>
        /// Show the window relative to provided screen rectangle.
        /// </summary>
        /// <param name="screenRect">Screen rectangle.</param>
        public void ShowRelative(Rectangle screenRect)
        {
            // Find screen middle points
            int yMid = screenRect.Y + (screenRect.Height / 2);
            int xMid = screenRect.X + (screenRect.Width / 2);

            // Find docking size middle points
            int yHalf = _dragData.DockWindowSize.Height / 2;
            int xHalf = _dragData.DockWindowSize.Width / 2;

            if (_dragData.ShowLeft && !_dragData.ShowRight && !_dragData.ShowMiddle && !_dragData.ShowTop && !_dragData.ShowBottom)
            {
                Location = new Point(screenRect.Left + 10, yMid - yHalf);
            }
            else if (!_dragData.ShowLeft && _dragData.ShowRight && !_dragData.ShowMiddle && !_dragData.ShowTop && !_dragData.ShowBottom)
            {
                Location = new Point(screenRect.Right - _dragData.DockWindowSize.Width - 10, yMid - yHalf);
            }
            else if (!_dragData.ShowLeft && !_dragData.ShowRight && !_dragData.ShowMiddle && _dragData.ShowTop && !_dragData.ShowBottom)
            {
                Location = new Point(xMid - xHalf, screenRect.Top + 10);
            }
            else if (!_dragData.ShowLeft && !_dragData.ShowRight && !_dragData.ShowMiddle && !_dragData.ShowTop && _dragData.ShowBottom)
            {
                Location = new Point(xMid - xHalf, screenRect.Bottom - _dragData.DockWindowSize.Height - 10);
            }
            else
            {
                Location = new Point(xMid - xHalf, yMid - yHalf);
            }

            // Show the window without activating it (i.e. do not take focus)
            PI.ShowWindow(Handle, PI.ShowWindowCommands.SW_SHOWNOACTIVATE);
        }
コード例 #2
0
        /// <summary>
		/// Show the window relative to provided screen rectangle.
		/// </summary>
		/// <param name="screenRect">Screen rectangle.</param>
		public void ShowRelative(Rectangle screenRect)
		{
			// Find screen middle points
			int yMid = screenRect.Y + (screenRect.Height / 2);
			int xMid = screenRect.X + (screenRect.Width / 2);

            // Find docking size middle points
            int yHalf = _dragData.DockWindowSize.Height / 2;
            int xHalf = _dragData.DockWindowSize.Width / 2;

            Point location;
            if (_dragData.ShowLeft && !_dragData.ShowRight && !_dragData.ShowMiddle && !_dragData.ShowTop && !_dragData.ShowBottom)
                location = new Point(screenRect.Left + 10, yMid - yHalf);
            else if (!_dragData.ShowLeft && _dragData.ShowRight && !_dragData.ShowMiddle && !_dragData.ShowTop && !_dragData.ShowBottom)
                location = new Point(screenRect.Right - _dragData.DockWindowSize.Width - 10, yMid - yHalf);
            else if (!_dragData.ShowLeft && !_dragData.ShowRight && !_dragData.ShowMiddle && _dragData.ShowTop && !_dragData.ShowBottom)
                location = new Point(xMid - xHalf, screenRect.Top + 10);
            else if (!_dragData.ShowLeft && !_dragData.ShowRight && !_dragData.ShowMiddle && !_dragData.ShowTop && _dragData.ShowBottom)
                location = new Point(xMid - xHalf, screenRect.Bottom - _dragData.DockWindowSize.Height - 10);
            else
                location = new Point(xMid - xHalf, yMid - yHalf);

            // Update the image for display
            UpdateLayeredWindow(new Rectangle(location, _showRect.Size));
            
			// Show the window without activating it (i.e. do not take focus)
			PI.ShowWindow(this.Handle, (short)PI.SW_SHOWNOACTIVATE);
		}
コード例 #3
0
 /// <summary>
 /// Hide the window from display.
 /// </summary>
 public void Hide()
 {
     PI.ShowWindow(Handle, PI.ShowWindowCommands.SW_HIDE);
 }
コード例 #4
0
 /// <summary>
 /// Show the window without taking activation.
 /// </summary>
 public void ShowWithoutActivate()
 {
     // Show the window without activating it (i.e. do not take focus)
     PI.ShowWindow(Handle, PI.ShowWindowCommands.SW_SHOWNOACTIVATE);
 }
コード例 #5
0
 /// <summary>
 /// Hide the window from display.
 /// </summary>
 public void Hide()
 {
     PI.ShowWindow(this.Handle, (short)PI.SW_HIDE);
 }
コード例 #6
0
 /// <summary>
 /// Show the window without taking activation.
 /// </summary>
 public void ShowWithoutActivate()
 {
     // Show the window without activating it (i.e. do not take focus)
     PI.ShowWindow(this.Handle, (short)PI.SW_SHOWNOACTIVATE);
 }