Search
Module:
Directory

Desktop Functions:

Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
WindowHitTestRegions (Enums)
.

WindowHitTestRegions

Summary

This enumeration was custom-built to identify the return value passed back by the WndProc method when it processes this message.

Most of these relate to the non-client (NC) region of the form. The client region of the form is the region where the normal interactive controls are placed, whereas the non-client section of a form includes the border, title bar, minimize, maximize, close and help buttons, etc. which make up the OS look and feel.

C# Definition:

/// <summary>Options available when a form is tested for mose positions.</summary>
enum WindowHitTestRegions
{
    /// <summary>HTERROR: On the screen background or on a dividing line between windows
    /// (same as HTNOWHERE, except that the DefWindowProc function produces a system
    /// beep to indicate an error).</summary>
    Error = -2,
    /// <summary>HTTRANSPARENT: In a window currently covered by another window in the
    /// same thread (the message will be sent to underlying windows in the same thread
    /// until one of them returns a code that is not HTTRANSPARENT).</summary>
    TransparentOrCovered = -1,
    /// <summary>HTNOWHERE: On the screen background or on a dividing line between
    /// windows.</summary>
    NoWhere = 0,
    /// <summary>HTCLIENT: In a client area.</summary>
    ClientArea = 1,
    /// <summary>HTCAPTION: In a title bar.</summary>
    TitleBar = 2,
    /// <summary>HTSYSMENU: In a window menu or in a Close button in a child window.</summary>
    SystemMenu = 3,
    /// <summary>HTGROWBOX: In a size box (same as HTSIZE).</summary>
    GrowBox = 4,
    /// <summary>HTMENU: In a menu.</summary>
    Menu = 5,
    /// <summary>HTHSCROLL: In a horizontal scroll bar.</summary>
    HorizontalScrollBar = 6,
    /// <summary>HTVSCROLL: In the vertical scroll bar.</summary>
    VerticalScrollBar = 7,
    /// <summary>HTMINBUTTON: In a Minimize button. </summary>
    MinimizeButton = 8,
    /// <summary>HTMAXBUTTON: In a Maximize button.</summary>
    MaximizeButton = 9,
    /// <summary>HTLEFT: In the left border of a resizable window (the user can click
    /// the mouse to resize the window horizontally).</summary>
    LeftSizeableBorder = 10,
    /// <summary>HTRIGHT: In the right border of a resizable window (the user can click
    /// the mouse to resize the window horizontally).</summary>
    RightSizeableBorder = 11,
    /// <summary>HTTOP: In the upper-horizontal border of a window.</summary>
    TopSizeableBorder = 12,
    /// <summary>HTTOPLEFT: In the upper-left corner of a window border.</summary>
    TopLeftSizeableCorner = 13,
    /// <summary>HTTOPRIGHT: In the upper-right corner of a window border.</summary>
    TopRightSizeableCorner = 14,
    /// <summary>HTBOTTOM: In the lower-horizontal border of a resizable window (the
    /// user can click the mouse to resize the window vertically).</summary>
    BottomSizeableBorder = 15,
    /// <summary>HTBOTTOMLEFT: In the lower-left corner of a border of a resizable
    /// window (the user can click the mouse to resize the window diagonally).</summary>
    BottomLeftSizeableCorner = 16,
    /// <summary>HTBOTTOMRIGHT: In the lower-right corner of a border of a resizable
    /// window (the user can click the mouse to resize the window diagonally).</summary>
    BottomRightSizeableCorner = 17,
    /// <summary>HTBORDER: In the border of a window that does not have a sizing
    /// border.</summary>
    NonSizableBorder = 18,
    /// <summary>HTOBJECT: Unknown...No Documentation Found</summary>
    Object = 19,
    /// <summary>HTCLOSE: In a Close button.</summary>
    CloseButton = 20,
    /// <summary>HTHELP: In a Help button.</summary>
    HelpButton = 21,
    /// <summary>HTSIZE: In a size box (same as HTGROWBOX). (Same as GrowBox).</summary>
    SizeBox = GrowBox,
    /// <summary>HTREDUCE: In a Minimize button. (Same as MinimizeButton).</summary>
    ReduceButton = MinimizeButton,
    /// <summary>HTZOOM: In a Maximize button. (Same as MaximizeButton).</summary>
    ZoomButton = MaximizeButton,
}

VB.NET Definition:

''' <summary>Options available when a form is tested for mose positions.</summary>
Enum WindowHitTestRegions
    ''' <summary>HTERROR: On the screen background or on a dividing line between windows
    ''' (same as HTNOWHERE, except that the DefWindowProc function produces a system
    ''' beep to indicate an error).</summary>
    [Error] = -2
    ''' <summary>HTTRANSPARENT: In a window currently covered by another window in the
    ''' same thread (the message will be sent to underlying windows in the same thread
    ''' until one of them returns a code that is not HTTRANSPARENT).</summary>
    TransparentOrCovered = -1
    ''' <summary>HTNOWHERE: On the screen background or on a dividing line between
    ''' windows.</summary>
    NoWhere = 0
    ''' <summary>HTCLIENT: In a client area.</summary>
    ClientArea = 1
    ''' <summary>HTCAPTION: In a title bar.</summary>
    TitleBar = 2
    ''' <summary>HTSYSMENU: In a window menu or in a Close button in a child window.</summary>
    SystemMenu = 3
    ''' <summary>HTGROWBOX: In a size box (same as HTSIZE).</summary>
    GrowBox = 4
    ''' <summary>HTMENU: In a menu.</summary>
    Menu = 5
    ''' <summary>HTHSCROLL: In a horizontal scroll bar.</summary>
    HorizontalScrollBar = 6
    ''' <summary>HTVSCROLL: In the vertical scroll bar.</summary>
    VerticalScrollBar = 7
    ''' <summary>HTMINBUTTON: In a Minimize button. </summary>
    MinimizeButton = 8
    ''' <summary>HTMAXBUTTON: In a Maximize button.</summary>
    MaximizeButton = 9
    ''' <summary>HTLEFT: In the left border of a resizable window (the user can click
    ''' the mouse to resize the window horizontally).</summary>
    LeftSizeableBorder = 10
    ''' <summary>HTRIGHT: In the right border of a resizable window (the user can click
    ''' the mouse to resize the window horizontally).</summary>
    RightSizeableBorder = 11
    ''' <summary>HTTOP: In the upper-horizontal border of a window.</summary>
    TopSizeableBorder = 12
    ''' <summary>HTTOPLEFT: In the upper-left corner of a window border.</summary>
    TopLeftSizeableCorner = 13
    ''' <summary>HTTOPRIGHT: In the upper-right corner of a window border.</summary>
    TopRightSizeableCorner = 14
    ''' <summary>HTBOTTOM: In the lower-horizontal border of a resizable window (the
    ''' user can click the mouse to resize the window vertically).</summary>
    BottomSizeableBorder = 15
    ''' <summary>HTBOTTOMLEFT: In the lower-left corner of a border of a resizable
    ''' window (the user can click the mouse to resize the window diagonally).</summary>
    BottomLeftSizeableCorner = 16
    ''' <summary>HTBOTTOMRIGHT: In the lower-right corner of a border of a resizable
    ''' window (the user can click the mouse to resize the window diagonally).</summary>
    BottomRightSizeableCorner = 17
    ''' <summary>HTBORDER: In the border of a window that does not have a sizing
    ''' border.</summary>
    NonSizableBorder = 18
    ''' <summary>HTOBJECT: Unknown...No Documentation Found</summary>
    [Object] = 19
    ''' <summary>HTCLOSE: In a Close button.</summary>
    CloseButton = 20
    ''' <summary>HTHELP: In a Help button.</summary>
    HelpButton = 21
    ''' <summary>HTSIZE: In a size box (same as HTGROWBOX). (Same as GrowBox).</summary>
    SizeBox = GrowBox
    ''' <summary>HTREDUCE: In a Minimize button. (Same as MinimizeButton).</summary>
    ReduceButton = MinimizeButton
    ''' <summary>HTZOOM: In a Maximize button. (Same as MaximizeButton).</summary>
    ZoomButton = MaximizeButton
End Enum

Notes:

None.

Documentation
None - this was custom-bulit to support the WM_SIZING notification. You may check at WM_NCHITTEST @msdn on MSDN for more information.

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it!


Find memory leaks fast

Is your application using too much memory, but you are not sure why? Holding on to too many objects?

Get to the root of your problem fast, with ANTS Memory Profiler

Download Now
 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions