GSerg » 17.01.2006 (Вт) 14:57
- Код: Выделить всё
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 Long) As Long
Private Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As Long
Private Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, ByRef lpRect As RECT) As Long
Private Declare Function MapWindowPoints Lib "user32.dll" (ByVal hwndFrom As Long, ByVal hwndTo As Long, ByRef lppt As Any, ByVal cPoints As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const SM_CYCAPTION As Long = 4
Private Const SM_CXEDGE As Long = 45
Private Const SM_CYEDGE As Long = 46
Private Sub Command1_Click()
Static f As Boolean
Dim r As RECT
If f Then
SetWindowRgn Me.hwnd, 0, 1
Else
GetWindowRect Me.hwnd, r
MapWindowPoints 0, Me.hwnd, r, 2
SetWindowRgn Me.hwnd, CreateRectRgn(0, GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYEDGE) + 1, r.Right + GetSystemMetrics(SM_CXEDGE) * 2, r.Bottom - r.Top + GetSystemMetrics(SM_CYEDGE)), 1
End If
f = Not f
End Sub
Как только вы переберёте все варианты решения и не найдёте нужного, тут же обнаружится решение, простое и очевидное для всех, кроме вас