You are on page 1of 1

Imports System.Runtime.

InteropServices
Public Class Form1
<StructLayout(LayoutKind.Sequential)> _
Public Structure MARGINS
Public Right As Integer
Public left As Integer
Public Top As Integer
Public Bottom As Integer
End Structure
<DllImport("dwmapi.dll")> _
Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef
pMarinset As MARGINS) As Integer
End Function

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
Dim margins As MARGINS = New MARGINS
margins.left = -1
margins.Right = -1
margins.Top = -1
margins.Bottom = -1
Dim hwnd As IntPtr = Handle
Dim result As Integer = DwmExtendFrameIntoClientArea(hwnd, margins)
Me.BackColor = Color.Black

End Sub
End Class

You might also like