Desktop Functions: Smart Device Functions:
|
Search Results for "RECT" in [All]user32
static extern bool AdjustWindowRectEx(ref Rect lpRect, uint dwStyle,
Public Function AdjustWindowRectEx(<MarshalAs(UnmanagedType.Struct)>byref lpRect As RECT, _
Public Declare Function AdjustWindowRectEx Lib "user32" _
(lpRect As RECT, _ System.Windows.Rect
static extern bool AdjustWindowRectEx(ref RECT lpRect, uint dwStyle,
Public Function AdjustWindowRectEx(<MarshalAs(UnmanagedType.Struct)>byref lpRect As RECT, _
Public Declare Function AdjustWindowRectEx Lib "user32" _
(lpRect As RECT, _ 3: AlignRects The multiple-window-position structure is an internal structure; an application cannot access it directly. 5: BlockInput Useful to create a temporary block in input for sensitive GUI operations. For instance when manually activating a screen saver from within a GUI function, a short blocking delay will prevent the user mouse movements directly after selection from accidently escaping the screen saver.
/// installed hooks will not receive hook notifications and may behave incorrectly as a result. You should call
IntPtr lpRect, uint cKids, IntPtr [] lpKids);
static extern TODO ClientRectangle(TODO);
Declare Function ClientRectangle Lib "user32.dll" (TODO) As TODO
Control.RectangleToScreen 10: ClipCursor
static extern bool ClipCursor(ref RECT lpRect);
Private Declare Function ClipCursor Lib "user32"(ByRef lpRect As RECT) As Long
public struct RECT
/// Left position of the rectangle.
/// Top position of the rectangle.
/// Right position of the rectangle.
/// Bottom position of the rectangle.
/// Operator to convert a RECT to Drawing.Rectangle.
/// <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);
/// Operator to convert Drawing.Rectangle to a RECT.
/// <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);
public RECT(int left, int top, int right, int bottom)
RECT rect =new RECT( 10, 10, 20, 20 );
ClipCursor(ref rect); 11: CopyIcon
string folderPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 12: CopyRect 13: CreateDesktop If you come across this error "System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #6': Invalid managed/unmanaged type combination (this value type must be paired with Struct).", you may want to use 15: CreateIcon
static extern IntPtr CreateIconIndirect([In] ref ICONINFO piconinfo);
private static extern IntPtr CreateIconIndirect([In] ref ICONINFO iconInfo);
IntPtr handle = CreateIconIndirect(ref ii);
static extern IntPtr CreateIconIndirect([In] ref ICONINFO piconinfo);
private static extern IntPtr CreateIconIndirect([In] ref ICONINFO iconInfo);
IntPtr handle = CreateIconIndirect(ref ii); 17: CreatePopupMenu
// Get info about the directory 18: CreateWindowEx
RECT rect;
Win32.GetClientRect (hWnd, out rect) ;
Win32.DrawText (hdc, "Hello, Windows 98!", -1, ref rect, Either use this name directly or modify the first line of the signature to:
static extern bool DrawAnimatedRects(IntPtr hwnd, int idAni,
[In] ref RECT lprcFrom, [In] ref RECT lprcTo); Since only IDANI_CAPTION is implemented, to get the effect of IDANI_OPEN, simply swap the lprcFrom and lprcTo rectangles, but still specify the IDANI_CAPTION constant.
struct RECT
public RECT(System.Drawing.Rectangle rectangle)
Left = rectangle.Left;
Top = rectangle.Top;
Right = rectangle.Right;
Bottom = rectangle.Bottom;
public RECT(System.Drawing.Point location, System.Drawing.Size size)
static extern bool DrawAnimatedRects(System.IntPtr hwnd, int idAni,
[System.Runtime.InteropServices.In] ref RECT lprcFrom,
[System.Runtime.InteropServices.In] ref RECT lprcTo);
static extern bool GetWindowRect(System.IntPtr hWnd, out RECT lpRect);
RECT from = new RECT(form.Location, form.Size);
RECT to;
GetWindowRect(hWnd, out to);
DrawAnimatedRects(form.Handle, IDANI_CAPTION, ref to, ref from);
DrawAnimatedRects(form.Handle, IDANI_CAPTION, ref from, ref to);
ref struct RECT {
RECT() {
RECT(System::Drawing::Rectangle rectangle) {
Left = rectangle.Left;
Top = rectangle.Top;
Right = rectangle.Right;
Bottom = rectangle.Bottom;
RECT(System::Drawing::Point location, System::Drawing::Size size) {
bool DrawAnimatedRects(int hwnd, int idAni, RECT^ lprcFrom, RECT^ lprcTo);
bool GetWindowRect(int hWnd, RECT^ lpRect);
RECT^ from=gcnew RECT(this->Location, this->Size);
RECT^ to=gcnew RECT();
GetWindowRect(hWnd, to);
DrawAnimatedRects(this->Handle.ToInt32(), IDANI_CAPTION, to, from);
DrawAnimatedRects(this->Handle.ToInt32(), IDANI_CAPTION, from, to); 22: DrawEdge
static extern bool DrawEdge(IntPtr hdc, ref RECT qrc, uint edge, 23: DrawFocusRect
static extern bool DrawFocusRect(IntPtr hDC, [In] ref RECT lprc);
Public Declare Auto Function DrawFocusRect Lib "user32" ( _
ByRef lpRect As Rect _
<StructLayout(LayoutKind.Explicit)> Public Structure Rect Where DrawFocusRect is used:
Dim FR As Win32.Rect
FR = New Win32.Rect
Win32.DrawFocusRect(hdc, FR) 'static/shared method
// The following style can be used to adjust the bounding rectangle of the push button.
/// Bounding rectangle is adjusted to exclude the surrounding edge of the push button.
DFCS_ADJUSTRECT = 0x2000, 25: DrawText
ref RECT lprc, uint dwDTFormat, ref DRAWTEXTPARAMS lpDTParams); private const int DT_CALCRECT = 0x00000400; 26: DrawTextEx
ref RECT lprc, uint dwDTFormat, ref DRAWTEXTPARAMS lpDTParams);
delegate bool MonitorEnumDelegate(IntPtr hMonitor, IntPtr hdcMonitor, ref Rect lprcMonitor, IntPtr dwData);
public struct Rect
public Rect MonitorArea { get; set; }
public Rect WorkArea { get; set; }
delegate (IntPtr hMonitor, IntPtr hdcMonitor, ref Rect lprcMonitor, IntPtr dwData) 28: EqualRect 29: FillRect
static extern int FillRect(IntPtr hDC, [In] ref RECT lprc, IntPtr hbr);
Private Shared Function FillRect(hDC As IntPtr, ByRef lprc As RECT, hbr As IntPtr) As Integer 30: FrameRect 31: GetClientRect
static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);
Private Shared Function GetClientRect(ByVal hWnd As System.IntPtr, _
ByRef lpRECT As RECT) As Integer The Win32 RECT structure is not compatible with the .NET System.Drawing.Rectangle structure.
public static RECT GetClientRect(IntPtr hWnd)
RECT result;
GetClientRect(hWnd, out result);
RECT clientRect = GetClientRect(handle); ClientRectangle property of the System.Windows.Forms.Control class 32: GetComboBoxInfo 33: GetCursorInfo 34: GetDCEx
/// <summary>DCX_WINDOW: Returns a DC that corresponds to the window rectangle rather
/// than the client rectangle.</summary> 35: GetGUIThreadInfo
public System.Drawing.Rectangle rcCaret;
public System.Drawing.Rectangle rcCaret;
internal struct Rect
public Rect rcCaret; 36: GetMenuItemRect 37: GetMonitorInfo internal delegate bool MonitorEnumProc(IntPtr hMonitor, IntPtr hdcMonitor, ref RECT lprcMonitor, IntPtr dwData); private bool MonitorEnumCallBack(IntPtr hMonitor, IntPtr hdcMonitor, ref RECT lprcMonitor, IntPtr dwData) 38: GetParent DoNotIndirectlyExposeMethodsWithLinkDemands 'NativeMethods.GetParentSafe(IntPtr)' calls into 'Marshal.GetLastWin32Error()' which has a LinkDemand. By making this call, 'Marshal.GetLastWin32Error()' is indirectly exposed to user code. Review the following protection: 39: GetScrollBarInfo
public Rectangle rcScrollBar; This didn't work for me with the Rectangle type for SCROLLBARINFO.rcScrollBar. To rectify this I altered this declaration to type RECT using the following standard definition.
public struct RECT 40: GetScrollInfo
Declare Function GetScrollInfo Lib "user32" (ByVal hWnd As IntPtr, ByVal fnBar As ScrollBarDirection, ByRef lpsi As SCROLLINFO) As Integer
GetScrollInfo( RichTextBox1.Handle, (int) ScrollBarDirection.SB_HORZ, ref si ); 41: GetSystemMetrics The SM_ARRANGE setting specifies how the system arranges minimized windows, and consists of a starting position and a direction. The starting position can be one of the following values. The direction in which to arrange can be one of the following values. 42: GetUpdateRect
public extern static bool GetUpdateRect(IntPtr hWnd, ref RECT rect, bool bErase);
Private Shared Function GetUpdateRect(ByVal hWnd As IntPtr, ByRef rect As RECT, ByVal bErase As Boolean) As Boolean
Dim rRect As New RECT
GetUpdateRect(Me.Handle, rRect, bErase) 43: GetWindowInfo Note that the members of the RECT structure should be int, not long. In some other API functions they are long, so this can be confusing. 44: GetWindowLong
// GetWindowLongPtr directly 45: GetWindowLongPtr
// GetWindowLongPtr directly
/// Before calling GetWindowPlacement, set the length member to sizeof(WINDOWPLACEMENT). GetWindowPlacement fails if lpwndpl-> length is not set correctly.
public System.Drawing.Rectangle rcNormalPosition;
Private Structure RECT
Public rcNormalPosition As RECT 47: GetWindowPos Use GetWindowRect Win32 method for position information. 48: GetWindowRect
static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);
Private Shared Function GetWindowRect(ByVal hWnd As HandleRef, ByRef lpRect As RECT) As Boolean The Win32 RECT is not binary compatible with System.Drawing.Rectangle.
static extern bool GetWindowRect(HandleRef hWnd, out RECT lpRect);
public struct RECT
Rectangle myRect = new Rectangle();
RECT rct;
if(!GetWindowRect(new HandleRef(this, this.Handle), out rct ))
myRect.X = rct.Left;
myRect.Y = rct.Top;
myRect.Width = rct.Right - rct.Left + 1;
myRect.Height = rct.Bottom - rct.Top + 1; 49: HandleRef
myCorrectFunction() { 50: InflateRect 51: IntersectRect 52: InvalidateRect
static extern bool InvalidateRect(IntPtr hWnd, IntPtr lpRect, bool bErase);
Public Overloads Declare Function InvalidateRect Lib "User32" Alias "InvalidateRect" (ByVal hWnd As Int32, ByRef lpRect As RECT, ByVal bErase As Boolean) As Boolean
Public Overloads Declare Function InvalidateRect Lib "User32" Alias "InvalidateRect" (ByVal hWnd As Int32, ByVal lpRect As IntPtr, ByVal bErase As Boolean) As Boolean
Public Overloads Shared Function InvalidateRect(ByVal hWnd As Int32, ByVal bErase As Boolean) As Boolean
Return InvalidateRect(hWnd, IntPtr.Zero, bErase)
Public Overloads Shared Function InvalidateRect(ByVal hWnd As Int32, ByVal lpRect As System.Drawing.Rectangle, ByVal bErase As Boolean) As Boolean
Return InvalidateRect(hWnd, RECT.FromRectangle(lpRect), bErase) Setting the second param (lpRect) to IntPtr.Zero will redraw the whole client area.
RECT rct;
Rectangle R;
GetWindowRect(hWnd, out rct);
/** draw a red border around your rectangle **/
/** when you want to clear this rectangle, use this **/
InvalidateRect(hWnd, IntPtr.Zero, true);
Invalidate(Rectangle rect) - Adds the specified rectangle to the update region of the control
Invalidate(Rectangle rect, bool invalidateChildern) - combination of the previous two. 53: InvalidateRgn
Invalidate(Rectangle rect) - Adds the specified rectangle to the update region of the control and causes a paint message to be sent to the control.
Invalidate(Rectangle rect, bool invalidateChildern) - combination of the previous two. 54: InvertRect
static extern bool InvertRect(IntPtr hDC, [In] ref RECT lprc);
Public Declare Function InvertRect Lib "user32" Alias "InvertRect" (ByVal hdc As Integer, <MarshalAs(UnmanagedType.Struct)> ByRef lpRect As RECT) As Integer
<StructLayout(LayoutKind.Sequential)> Public Structure RECT
Dim loSelected As RECT
InvertRect(hdc.ToInt32, loSelected) 55: IsRectEmpty 56: keybd_event Use FindWindow and SetForegroundWindow to direct input to the desired window. 57: LoadBitmap To correct this, the function declaration at your .NET code must be the next: 58: LoadMenuIndirect Cut off search results after 60. Please refine your search. |