Solved

Remove maximize button from MDI form

Posted on 2001-06-19
3
262 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

743 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

12 Experts available now in Live!

Get 1:1 Help Now