Copia y pega este codigo
Publicado por
hely (1 intervención) el 12/12/2004 03:22:20
'Llamar a la Funcion RecortarVentana en Form_Load
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Sub RecortarVentana()
On Error Resume Next
Dim Xpuntos As Variant
Dim Puntos() As POINTAPI
Dim NroPtos As Integer
Dim Handle As Long
Xpuntos = VBA.Array(20, 78, 53, 20, 80, 76, 11, 36, 82, 36)
NroPtos = 5
ReDim Preserve Puntos(NroPtos - 1)
For i = 0 To NroPtos - 1
Puntos(i).X = Xpuntos(i * 2)
Puntos(i).Y = Xpuntos((i * 2) + 1)
Next
Handle = CreatePolygonRgn(Puntos(0), NroPtos, 1)
SetWindowRgn Me.hWnd, Handle, 1
End Sub
Private Sub Form_Load()
RecortarVentana
End Sub