Solved

Remove maximize button from MDI form

Posted on 2001-06-19
3
270 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

840 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