Public hWnd As Long
Private lStyle As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_SYSMENU = &H80000
Private Sub UserForm_Initialize()
With Me
hWnd = FindWindow("ThunderDFrame", .Caption)
lStyle = GetWindowLong(.hWnd, GWL_STYLE)
lStyle = lStyle Xor WS_SYSMENU
SetWindowLong .hWnd, GWL_STYLE, lStyle
DrawMenuBar .hWnd
End With
End Sub