Solved

Remove maximize button from MDI form

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

803 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