(整)在窗体上凿了一个洞
这个例子在窗体上凿了一个洞
—————————-
Option Explicit
Private Declare Function CombineRgn Lib “gdi32″ (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function CreateRectRgn Lib “gdi32″ (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 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 Const RGN_XOR = 3
Private Sub Command1_Click()
Dim a As Long, b As Long
a = CreateRectRgn(0, 0, Me.Width / Screen.TwipsPerPixelX, Me.Height / Screen.TwipsPerPixelY)
b = CreateRectRgn(10, 10, 200, 200)
CombineRgn a, a, b, RGN_XOR
SetWindowRgn Me.hWnd, a, True
End Sub











