468,490 Members | 2,558 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,490 developers. It's quick & easy.

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 11234
ADezii
8,799 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,799 Expert 8TB
@convexcube
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.

Similar topics

reply views Thread by Manoj | last post: by
1 post views Thread by Prashant Joshi | last post: by
2 posts views Thread by Yasutaka Ito | last post: by
1 post views Thread by BudhramM | last post: by
1 post views Thread by Tim Bücker | last post: by
3 posts views Thread by gieforce | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.