Naked » 07.09.2005 (Ср) 3:09
или
сделай у формы BorderStyle=2, ScaleMode=3, вставь код. И будет тебе как надо
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 SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const SM_CXFRAME = 32
Private Const SM_CYBORDER = 6
Private Const SM_CYCAPTION = 4
Private Const HTCAPTION = 2
Private Const WM_NCLBUTTONDOWN = &HA1
Dim XY(3) As POINTAPI
Private Sub Form_Load()
Dim hRgn As Long
XY(0).X = GetSystemMetrics(SM_CXFRAME): XY(0).Y = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CXFRAME)
XY(1).X = GetSystemMetrics(SM_CXFRAME): XY(1).Y = ScaleHeight + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CXFRAME)
XY(2).X = ScaleWidth + GetSystemMetrics(SM_CXFRAME): XY(2).Y = ScaleHeight + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CXFRAME)
XY(3).X = ScaleWidth + GetSystemMetrics(SM_CXFRAME): XY(3).Y = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CXFRAME)
hRgn = CreatePolygonRgn(XY(0), 4, 2)
Call SetWindowRgn(hwnd, hRgn, True)
End Sub
Private Sub Form_DblClick()
End
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call ReleaseCapture
Call SendMessage(Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
End Sub