(整)在窗体上凿了一个洞

这个例子在窗体上凿了一个洞

—————————-

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

收藏本文到网摘: 百度搜藏 QQ书签 Google书签 Del.icio.us 新浪ViVi 雅虎收藏 饭否 365Key网摘 天极网摘 POCO网摘 和讯网摘

Random Posts

Leave a Reply