Article ID: 137033
Article Last Modified on 7/13/2004
Private Sub MDIForm_Load()
Dim L as Long
L = GetWindowLong(Me.hWnd, GWL_STYLE)
L = L And Not (WS_MINIMIZEBOX)
L = L And Not (WS_MAXIMIZEBOX)
L = SetWindowLong(Me.hWnd, GWL_STYLE, L)
End Sub
#If Win32 Then
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
#Else
Declare Function SetWindowLong Lib "User" (ByVal hwnd As Integer, _
ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
Declare Function GetWindowLong Lib "User" (ByVal hwnd As Integer, _
ByVal nIndex As Integer) As Long
#End If
Const WS_MINIMIZEBOX = &H20000
Const WS_MAXIMIZEBOX = &H10000
Const GWL_STYLE = (-16)
Sub MDIForm_Load()
Dim L as Long
L = GetWindowLong(Me.hWnd, GWL_STYLE)
L = L And Not (WS_MINIMIZEBOX)
L = L And Not (WS_MAXIMIZEBOX)
L = SetWindowLong(Me.hWnd, GWL_STYLE, L)
End Sub
' Enter the following Declare statement as one, single line:
Declare Function SetWindowLong Lib "User" (ByVal hwnd As Integer,
ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
' Enter the following Declare statement as one, single line:
Declare Function GetWindowLong Lib "User" (ByVal hwnd As Integer,
ByVal nIndex As Integer) As Long
Const WS_MINIMIZEBOX = &H20000
Const WS_MAXIMIZEBOX = &H10000
Const GWL_STYLE = (-16)
Keywords: kbhowto kbui KB137033