473,325 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Disable application maximize button

convexcube
Hi everyone,

Now that I've found a way to disable the ribbon etc. I need to disable the application maximize button. I have looked at this post and implemented it, but it disables the close and minimize buttons as well. Is there a simple command I can use to disable just this button or any way I can adapt the cited post to do just that?

Kind regards,

Ken.
Nov 27 '08 #1
3 12335
ADezii
8,834 Expert 8TB
Try this code in a Standard Code Module, then Call the Function:
Expand|Select|Wrap|Line Numbers
  1. Private Const GWL_STYLE = (-16)
  2. Private Const WS_MAXIMIZEBOX = &H10000
  3.  
  4. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
  5.         (ByVal hwnd As Long, ByVal nIndex As Long, _
  6.         ByVal dwNewLong As Long) As Long
  7. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
  8.         (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Expand|Select|Wrap|Line Numbers
  1. Function DisableMAXIMIZE() As Long
  2. Dim hMenu As Long
  3. Dim lStyle As Long
  4. Dim Lhwnd As Long
  5.  
  6. Lhwnd = Access.Application.hWndAccessApp
  7.  
  8. 'Disable MAXIMIZE button
  9. lStyle = GetWindowLong(Lhwnd, GWL_STYLE)
  10. lStyle = lStyle And Not WS_MAXIMIZEBOX
  11.  
  12. Call SetWindowLong(Lhwnd, GWL_STYLE, lStyle)
  13. End Function
Nov 28 '08 #2
Thanks ADezii, works a treat. Much Appreciated, Ken
Dec 3 '08 #3
ADezii
8,834 Expert 8TB
@convexcube
Glad it worked for you.
Dec 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Manoj | last post by:
Hi All, We have an VB.net application which has 31 projects in one solution.In this we want to disable the Maximize and minimize buttons of the child forms as they load in the main MDI.We have...
1
by: Prashant Joshi | last post by:
Hi all, I am using javascript to open a popup window. Is there any way we can disable the minimize button in this window? The maximize button is disabled. I want the same for the minimize button....
2
by: Godfried van Loo | last post by:
Dear all, I believe many people have this problem. I wanted to disable the minimize and maximize buttons in my popup window. It is impossible, I know, but I found something else... Using...
2
by: Yasutaka Ito | last post by:
Hi, Is there any way to disable the "Normal" button of the form? A button displayed between the Minimum and Maximize button? I want the user to be allowed to either minimized or maximized, but...
1
by: BudhramM | last post by:
I have created a frameset which is my default page. I am using window.resizeto and window.move to size and position the window on the users screen, but I also need to disable the maximize button on...
1
by: Tim Bücker | last post by:
Hello. I have a form with some controls on it. One of these controls is a button that disables/ enables all the other controls. The form itself should also be "disabled/enabled", so I set...
2
by: Sharon | last post by:
In the Form there is the Control/System menu. I wish to prevent this system menu from poping-up although the minimize, maximize and close buttons is still shown on the Form caption bar. How can...
0
by: erseenu4 | last post by:
I would like to create a pop window. The windows maximize button/minimize button must be disabled. I would really appreciate if anyone can help me in doing so. With Regards, Srinivasan
1
by: kenzs | last post by:
Hi! how to disable close(x) button in web form, i want only close button,don't disable in maximize button ,minimize button
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.