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 Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal _
hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SWP_DRAWFRAME = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Private Const SWP_FLAGS = SWP_NOZORDER Or SWP_NOSIZE Or _
SWP_NOMOVE Or SWP_DRAWFRAME
Private Const GWL_STYLE = (-16)
Private Const WS_THICKFRAME = &H40000
Private Sub SetControlStyle(style, X As Control)
Dim r
If style Then
Call SetWindowLong(X.hwnd, GWL_STYLE, style)
Call SetWindowPos(X.hwnd, Form1.hwnd, 0, 0, 0, 0, SWP_FLAGS)
End If
End Sub
Private Sub Form_Load()
Dim style As Long
style = GetWindowLong(Text1.hwnd, GWL_STYLE)
style = style Or WS_THICKFRAME
SetControlStyle style, Text1
End Sub