即时手工写的,没有调试过,请原谅。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 LongPrivate Const GWL_STYLE = (-16)Private Const WS_CAPTION = &HC00000Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOSIZE = &H1   Dim nStyle As Long
   dim m_hWnd as long 
   dim value as boolean
  
   value=false   m_hWnd=mdiform1.hwnd
   
   nStyle = GetWindowLong(m_hWnd, GWL_STYLE)
   
   If Value Then 
      nStyle = nStyle Or WS_CAPTION
   Else
      nStyle = nStyle And Not WS_CAPTION
   End If
   Call SetWindowLong(m_hWnd, GWL_STYLE, nStyle)   SetWindowPos m_hWnd, 0, 0, 0, 0, 0,       SWP_FRAMECHANGED Or SWP_NOMOVE Or _
      SWP_NOZORDER Or SWP_NOSIZE