用API函数使MDIForm窗口的标题栏隐藏就行了'使MDI窗体标题栏隐藏 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, ByValdwNewLong As Long) As LongPrivate Const GWL_STYLE = (-16) Private Const WS_CAPTION = &HC00000 Private Const WS_SYSMENU = &H80000'用于使窗口标题栏隐藏 Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle Xor WS_CAPTION Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle)
Private Const WS_THICKFRAME = &H40000 Private Const GWL_EXSTYLE = (-20) Private Const GWL_STYLE = (-16) 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 Sub Form_Load() Dim xl As Long
Me.Show Debug.Print Hex(Not WS_THICKFRAME) xl = GetWindowLong(Form1.hwnd, GWL_STYLE) xl = xl And (Not WS_THICKFRAME) SetWindowLong Form1.hwnd, GWL_STYLE, xl End Sub
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long Private Const SC_SIZE = &HF000 Private Const MF_BYCOMMAND = &H0&
Private Sub Form_Load() Dim hMenu As Long, Success As Long
hMenu = GetSystemMenu(Form1.hwnd, 0) Success = DeleteMenu(hMenu, SC_SIZE, MF_BYCOMMAND) End Sub
Private Const WS_THICKFRAME = &H40000 Private Const GWL_EXSTYLE = (-20) Private Const GWL_STYLE = (-16) 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 Sub Form_Load() Dim xl As Long
Me.Show Debug.Print Hex(Not WS_THICKFRAME) xl = GetWindowLong(Form1.hwnd, GWL_STYLE) xl = xl And (Not WS_THICKFRAME) SetWindowLong Form1.hwnd, GWL_STYLE, xl End Sub
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, ByValdwNewLong As Long) As LongPrivate Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_SYSMENU = &H80000'用于使窗口标题栏隐藏
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lStyle = lStyle Xor WS_CAPTION
Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle)
Private Const GWL_EXSTYLE = (-20)
Private Const GWL_STYLE = (-16)
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 Sub Form_Load()
Dim xl As Long
Me.Show
Debug.Print Hex(Not WS_THICKFRAME)
xl = GetWindowLong(Form1.hwnd, GWL_STYLE)
xl = xl And (Not WS_THICKFRAME)
SetWindowLong Form1.hwnd, GWL_STYLE, xl
End Sub
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const SC_SIZE = &HF000
Private Const MF_BYCOMMAND = &H0&
Private Sub Form_Load()
Dim hMenu As Long, Success As Long
hMenu = GetSystemMenu(Form1.hwnd, 0)
Success = DeleteMenu(hMenu, SC_SIZE, MF_BYCOMMAND)
End Sub
Private Const GWL_EXSTYLE = (-20)
Private Const GWL_STYLE = (-16)
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 Sub Form_Load()
Dim xl As Long
Me.Show
Debug.Print Hex(Not WS_THICKFRAME)
xl = GetWindowLong(Form1.hwnd, GWL_STYLE)
xl = xl And (Not WS_THICKFRAME)
SetWindowLong Form1.hwnd, GWL_STYLE, xl
End Sub