MDI form

baddy
08-30-2000, 03:27 AM
Is there any way to remove the minimized, maximized icons on the MDI parent form? If not, can anyone tell me the values? (in hexadecimal for the minimized and maximized buttons)

BillSoo
08-30-2000, 12:42 PM
Try the SetWindowLong and GetWindowLong API calls. Here are some constants that are used with these functions:

Const WS_MINIMIZEBOX = &H20000
Const WS_MAXIMIZEBOX = &H10000

I haven't tried this myself but I understand that not all windows can be modified. But if an MDI form can be modified, this is the most likely way.

"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

baddy
08-30-2000, 08:54 PM
BillSoo, how do I use the API calls you mentioned earlier?

BillSoo
08-31-2000, 01:14 PM
Try this...

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 Long
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const GWL_STYLE = (-16)

Private Sub MDIForm_Initialize()
Dim i&
i& = GetWindowLong(Me.hwnd, GWL_STYLE)
i& = i& And Not WS_MAXIMIZEBOX
i& = i& And Not WS_MINIMIZEBOX
i& = SetWindowLong(Me.hwnd, GWL_STYLE, i&)
End Sub



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum