Активная области в реальности называется рабочей областью...
Возможно кому-нибуть пригодится (Подсмотренно в reflector'е и MSDN)
| Код | Imports System.Runtime.InteropServices
Public NotInheritable Class ScreenTools Const SPI_SETWORKAREA As Integer = &H2F Const SPI_GETWORKAREA As Integer = &H30
<StructLayout(LayoutKind.Sequential)> _ Private Structure RECT Public left As Integer Public top As Integer Public right As Integer Public bottom As Integer Public Sub New(ByVal left As Integer, ByVal top As Integer, ByVal right As Integer, ByVal bottom As Integer) Me.left = left Me.top = top Me.right = right Me.bottom = bottom End Sub
Public Sub New(ByVal r As Rectangle) Me.left = r.Left Me.top = r.Top Me.right = r.Right Me.bottom = r.Bottom End Sub
Public Shared Function FromXYWH(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer) As RECT Return New RECT(x, y, (x + width), (y + height)) End Function
Public ReadOnly Property Size() As Size Get Return New Size((Me.right - Me.left), (Me.bottom - Me.top)) End Get End Property
End Structure
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _ Private Shared Function SystemParametersInfo(ByVal nAction As Integer, ByVal nParam As Integer, ByRef rc As RECT, ByVal nUpdate As Integer) As Boolean
End Function
Public Shared Property WorkingArea() As Rectangle Get Dim rc As New RECT SystemParametersInfo(SPI_GETWORKAREA, 0, rc, 0) Return Rectangle.FromLTRB(rc.left, rc.top, rc.right, rc.bottom) End Get Set(ByVal value As Rectangle) Dim rc As New RECT(value) SystemParametersInfo(SPI_SETWORKAREA, 0, rc, 0) End Set End Property End Class
|
|