Option Explicit
Private Declare Function CreateRectRgn Lib "gdi32.dll" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32.dll" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Sub Form_Load()
With Me
.BorderStyle = vbFixedSingle
.Caption = "Some title"
End With
Dim hRgn As Long
hRgn = CreateRectRgn(0, 30, 150, 130)
Call SetWindowRgn(Me.hWnd, hRgn, True)
End Sub
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
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
Sub Form_Load()
SetWindowLong hWnd, GWL_STYLE, ((GetWindowLong(hWnd, GWL_STYLE) Or &HC50000) Xor &HC50000)
SetWindowRgn hWnd, CreateRectRgn(0, 0, Me.Width / Screen.TwipsPerPixelX, Me.Height / Screen.TwipsPerPixelY), True
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 109