By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,997 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,997 IT Pros & Developers. It's quick & easy.

Disable application maximize button

P: 47
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,

Nov 27 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 5K+
P: 8,627
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
  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
  6. Lhwnd = Access.Application.hWndAccessApp
  8. 'Disable MAXIMIZE button
  9. lStyle = GetWindowLong(Lhwnd, GWL_STYLE)
  10. lStyle = lStyle And Not WS_MAXIMIZEBOX
  12. Call SetWindowLong(Lhwnd, GWL_STYLE, lStyle)
  13. End Function
Nov 28 '08 #2

P: 47
Thanks ADezii, works a treat. Much Appreciated, Ken
Dec 3 '08 #3

Expert 5K+
P: 8,627
Glad it worked for you.
Dec 4 '08 #4

Post your reply

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