Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than user32, prefix the name with the module name and a period.
ClipCursor (user32)
.
C# Signature:
[System.Runtime.InteropServices.DllImport("user32.dll")]
[DllImport("user32.dll")]
static extern bool ClipCursor(ref RECT lpRect);
VB.Net Signature:
Private Declare Function ClipCursor Lib "user32"(ByRef lpRect As RECT) As Long
User-Defined Types:
public struct RECT
{
#region Variables.
/// <summary>
/// Left position of the rectangle.
/// </summary>
public int Left;
/// <summary>
/// Top position of the rectangle.
/// </summary>
public int Top;
/// <summary>
/// Right position of the rectangle.
/// </summary>
public int Right;
/// <summary>
/// Bottom position of the rectangle.
/// </summary>
public int Bottom;
#endregion
#region Operators.
/// <summary>
/// Operator to convert a RECT to Drawing.Rectangle.
/// </summary>
/// <param name="rect">Rectangle to convert.</param>
/// <returns>A Drawing.Rectangle</returns>
public static implicit operator Rectangle(RECT rect)
{
return Rectangle.FromLTRB(rect.Left, rect.Top, rect.Right, rect.Bottom);
}
/// <summary>
/// Operator to convert Drawing.Rectangle to a RECT.
/// </summary>
/// <param name="rect">Rectangle to convert.</param>
/// <returns>RECT rectangle.</returns>
public static implicit operator RECT(Rectangle rect)
{
return new RECT(rect.Left, rect.Top, rect.Right, rect.Bottom);
}
#endregion
#region Constructor.
/// <summary>
/// Constructor.
/// </summary>
/// <param name="left">Horizontal position.</param>
/// <param name="top">Vertical position.</param>
/// <param name="right">Right most side.</param>
/// <param name="bottom">Bottom most side.</param>
public RECT(int left, int top, int right, int bottom)
{
Left = left;
Top = top;
Right = right;
Bottom = bottom;
}
#endregion
}
RECT rect =new RECT( 10, 10, 20, 20 );
ClipCursor(ref rect);
Alternative Managed API:
System.Windows.Forms.Cursor.Clip
The ClipCursor API
10/12/2016 12:42:44 PM - -50.192.114.45
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).