disable restore and min button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

developing an application for a client using access 97 and i need to make the application very secure.
how do i deactivate the min and restore button on the top blue bar? all forms have min max set to none and
control box set to no.
 
This is kind of messy. See:
http://www.mvps.org/access/api/api0022.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

jn said:
developing an application for a client using access 97 and i need to make the application very secure.
how do i deactivate the min and restore button on the top blue bar? all
forms have min max set to none and
 
thanks, i saw that article but i do not have enough experience to use. i am not suggesting you
write anything, but i need more assistance

this is what i found for the close butto

Option Compare Databas
Option Explici

Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long,
ByVal bRevert As Long) As Lon

Private Declare Function EnableMenuItem Lib "user32" (ByVal hMenu As
Long, ByVal wIDEnableItem As Long, ByVal wEnable As Long) As Lon

Private Declare Function GetMenuItemInfo Lib "user32" Alias
"GetMenuItemInfoA" (ByVal hMenu As Long, ByVal un As Long, ByVal b As
Long, lpMenuItemInfo As MENUITEMINFO) As Lon

Private Type MENUITEMINF
cbSize As Lon
fMask As Lon
fType As Lon
fState As Lon
wID As Lon
hSubMenu As Lon
hbmpChecked As Lon
hbmpUnchecked As Lon
dwItemData As Lon
dwTypeData As Strin
cch As Lon
End Typ

Const MF_GRAYED = &H1
Const MF_BYCOMMAND = &H0
Const SC_CLOSE = &HF060


Public Property Get Enabled() As Boolea
Dim hWnd As Lon
Dim hMenu As Lon
Dim result As Lon
Dim MI As MENUITEMINF

MI.cbSize = Len(MI
MI.dwTypeData = String(80, 0
MI.cch = Len(MI.dwTypeData
MI.fMask = MF_GRAYE
MI.wID = SC_CLOS
hWnd = Application.hWndAccessAp
hMenu = GetSystemMenu(hWnd, 0
result = GetMenuItemInfo(hMenu, MI.wID, 0, MI
Enabled = (MI.fState And MF_GRAYED) =
End Propert

Public Property Let Enabled(boolClose As Boolean
Dim hWnd As Lon
Dim wFlags As Lon
Dim hMenu As Lon
Dim result As Lon

hWnd = Application.hWndAccessAp
hMenu = GetSystemMenu(hWnd, 0
If Not boolClose The
wFlags = MF_BYCOMMAND Or MF_GRAYE
Els
wFlags = MF_BYCOMMAND And Not MF_GRAYE
End I
result = EnableMenuItem(hMenu, SC_CLOSE, wFlags
End Propert

my first thoughts were to find the constant values and names for restore and mi
and just insert. but, of course, i did not find

i assume that there is more to the programming then just copying the maxrestore routine in th
paper you referenced
 
1. In the database window, click the Modules tab, and click New.

2. Paste the code into the new module.
Save with a name such as basDontMaximize.

3. Open your form in design view.

4. Open the Properties box (View menu).

5. Set the On Resize property to:
[Event Procedure]

6. Click the Build button (...) beside this.
Access opens a code window.

7. Between the "Private Sub..." and "End Sub" lines, paste:
If IsZoomed(Me.hWnd) Then
Call MaximizeRestoredForm(Me)
End If

8. Save your form.
 
thanks for all your help
however, this fixes the forms in the app, which i have already done

i am talking about the very top blue bar, that is under access control. i need to deactivate the restore and min
buttons, so that a user can not tamper with the app.
the code i sent takes care of the close button.
i was thinking that there had to be constants for restore and min and could then insert int
the code sent and make new modules for restore and min. have these new modules activate thr
autoexec

thanks
 
Back
Top