Imports System.Runtime.InteropServices
Module BorderRedondo
    Public SD As Integer
    Public Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (Dt As IntPtr, UI As Integer) As Integer
    Public Declare Function GetDesktopWindow Lib "user32" () As Integer
    Public Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (Dt As IntPtr, IDF As Integer, IGT As Integer) As Integer
    Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (Wo As IntPtr, Ni As Integer, Nk As Integer) As Integer


    Public Sub BorderRedondoFrm(Handle As System.IntPtr, Width As Integer, Height As Integer, btn As Button)
        Try
            'Form.FormBorderStyle = FormBorderStyle.None
            Const CS_DROPSHADOWN As Integer = &H20000
            SD = SetWindowLong(Handle, -8, GetDesktopWindow())
            SetClassLong(Handle, -26, GetClassLong(Handle, -26) Or CS_DROPSHADOWN)
            'Form.ShowInTaskbar = True
            btn.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, Width - 0, Height - 0, 10, 10))
        Catch ex As Exception

        End Try
    End Sub

    <DllImport("Gdi32.dll", EntryPoint:="CreateRoundRectRgn")>
    Public Function CreateRoundRectRgn(LR As Integer, TR As Integer, RR As Integer, BR As Integer, WE As Integer, HE As Integer) As IntPtr

    End Function
End Module