Style := GetWindowLongPtr(hWnd, GWL_STYLE); if Style = 0 then RaiseLastOSError; Style := Style and not (WS_SIZEBOX or WS_MAXIMIZEBOX or WS_SYSMENU); if SetWindowLongPtr(hWnd, GWL_STYLE, Style) = 0 then RaiseLastOSError;