Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
Available now!
Buy at Amazon US or
Buy at Amazon UK


» Windows API reference
» Webcam streaming in VB.NET
» Remoting with firewalls
» RSA from first principles
» Key & MouseLogger in .NET
» Networking Resource Kit for .NET
» Migrating VB6 Winsock to VB.NET
» Migrating C++ sockets to C#
» RFC Reference guide
» COM Reference guide
» WMI Reference guide
» SQL stored procedures
» TCP & UDP port reference
» NET Framework reference
» Ethernet Type codes
» MAC address assignments
» DLL entry point reference
» Boost SQL performance
» Free SMS UK
» Free SMS Ireland
» Free SMS South Africa
» Internet Explorer

Contact us

PtInRect Reference in C#, VB.NET and VB6


Visual Basic 6 definition
Declare Function PtInRect Lib "user32.dll" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long

Visual Basic .NET definition
Declare Function PtInRect Lib "user32" (ByRef lpRect As RECT, ByRef pt As POINTAPI) As Integer

C# definition
[DllImport("user32")] public static extern int PtInRect(ref RECT lpRect, ref POINTAPI pt)


Platforms: Win 32s, Win 95/98, Win NT PtInRect determines if a point lies inside or outside of a rectangle. Note that Windows considers the left and top edges of a rectangle to be inside it, and the right and bottom edges to be outside. The function returns 1 if the point is inside or 0 if it is outside. PtInRect Determines whether the specified point lies within the specified rectangle. System.Drawing.Rectangle.Contains


Further Information:

For further information on Windows API functions such as these, and how to use these API's in your C# and VB.NET applications, please refer to the book 'Network programming in .NET' (Buy at Amazon UK) (Buy at Amazon US)

Visual Basic 6 example source code

C# example source code

Provide a code example



Copyright 2018 Infinite Loop Ltd.