?
Solved

Remove maximize button from MDI form

Posted on 2001-06-19
3
Medium Priority
?
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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 …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

801 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