|
Option Explicit
Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal _
nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal _
nIndex As Long, ByVal dwNewLong As Long) As Long
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 uFlags As Long) As Long
Public Const GWL_EXSTYLE = -20
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOZORDER = &H4
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_FRAMECHANGED = &H20
Public Const WS_EX_CLIENTEDGE = &H200&
Public Sub FormVertiefen(Form As Form, vertiefen As Boolean)
Dim nWindowLong As Long
With Form
nWindowLong = GetWindowLong(.hwnd, GWL_EXSTYLE)
If vertiefen Then
nWindowLong = nWindowLong Or WS_EX_CLIENTEDGE
Else
nWindowLong = nWindowLong And Not WS_EX_CLIENTEDGE
End If
SetWindowLong .hwnd, GWL_EXSTYLE, nWindowLong
RedrawWindow .hwnd
End With
End Sub
Public Sub RedrawWindow(ByVal hwnd As Long)
Const Flags As Long = SWP_NOSIZE Or SWP_NOMOVE Or _
SWP_NOZORDER Or SWP_NOACTIVATE Or SWP_FRAMECHANGED
SetWindowPos hwnd, 0, 0, 0, 0, 0, Flags
End Sub
|
|