Yes, that will work, but it's just the same as disabling the the ControlBox property.
Just incase your interested, here's the code
Code: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 GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_SYSMENU = &H80000 Private Sub Form_Load() Dim wStyle As Long wStyle = GetWindowLong(hwnd, GWL_STYLE) wStyle = wStyle Xor WS_SYSMENU SetWindowLong hwnd, GWL_STYLE, wStyle End Sub




Reply With Quote