Solved

Remove maximize button from MDI form

Posted on 2001-06-19
3
265 Views
Last Modified: 2006-11-17
I want to remove the maximize button from an MDI form
using an API

i think SendWindowLong is the appropriate API
but i need the correct parameters


0
Comment
Question by:adl
3 Comments
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6206166
This does it for the close( X ) button. I think it is similar with a different parameter.

http://www.freevbcode.com/ShowCode.Asp?ID=342

Regards
Andrew
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6206230
Hi!

Here's another one : )

Download...
http://www.vb-helper.com/Howto/noclose.zip

Description: Disable the close X in a form's upper right corner (2K)

Just change the form to a MDI form with the same code and the name of the form if necessary.

That's it!

glass cookie : )
0
 
LVL 3

Accepted Solution

by:
jrspano earned 100 total points
ID: 6206267
here are the constants

Private Const MAXIMIZEBOX = &H10000
Private Const MINIMIZEBOX = &H20000
private const MAXIMIZE = &H1000000
Private Const GWL_STYLE = (-16)

code

Private Function ChangeWindowStyle(Style as long) as long
    Dim m_APIRet As Long
           
    m_APIRet = GetWindowLong(form.hwnd, GWL_STYLE)
    If Style < m_APIRet Then
        m_APIRet = m_APIRet - Style 'remove the style
        m_APIRet = SetWindowLong(form.hwnd, GWL_STYLE, m_APIRet)
    End If
   
    ChangeWindowStyle = (m_APIRet <> 0)
   
    Exit Function

end function

passin the MAXIMIZEBOX const to get rid of the box
passin MAXIMIZE = &H1000000 to get rid of the system drop down menu maximize
the maximize box will still show but the user won't be able to do anything with it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now