Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop user changing size of Access Application (not form)

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
Hello,

I want to make my database appear floating and compact.

I use the following code to prevent the user from using the Maximize Access Application button.

Code:
Option Compare Database
 Private Const GWL_STYLE = (-16)
 Private Const WS_MAXIMIZEBOX = &H10000
     
 Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
            (ByVal hwnd As Long, ByVal nIndex As Long, _
            ByVal dwNewLong As Long) As Long
 Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
            (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Public Function DisableMAXIMIZE() As Long
 Dim hMenu As Long
 Dim lStyle As Long
 Dim Lhwnd As Long
     
 Lhwnd = Access.Application.hWndAccessApp
     
 'Disable MAXIMIZE button
  lStyle = GetWindowLong(Lhwnd, GWL_STYLE)
  lStyle = lStyle And Not WS_MAXIMIZEBOX
     
  Call SetWindowLong(Lhwnd, GWL_STYLE, lStyle)
   
End Function

This works well, but still allows the user to resize the Application (not form) border / window size. Can anyone help me with some code to stop the Application window being able to be resized?

Thank you - Merry Christmas - Mark
 
Why? Why do you want to do it?
One of many points of Windows is to be able to resize, move, minimize, maximize, etc. applications on the screen/desktop.

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top