Newsgroup: it.comp.appl.access
Titolo: Bottone chiusura finestra Access

Ciao a tutti
Vorrei togliere il bottone di chiusura della finestra Access ma lasciare i
bottoni di ridimensionamento
....qualcuno puň aiutarmi ??
ciao e....grazieee

 ....qualcuno puņ aiutarmi ??
    Copia in un modulo Basic:
' ------------------------------------------------------------
  Option Compare Text
  Option Explicit
  Option Base 0
' ------------------------------------------------------------
' ------------------------------------------------------------
  Private Enum apiMF_Enum
' ------------------------------------------------------------
  MF_BYCOMMAND = &H0&
  MF_BYPOSITION = &H400&
  MF_CHECK = &H8
  MF_DISABLED = &H2&
  MF_GRAYED = &H1&
  MF_ENABLED = &H0&
  MF_REMOVE = &H1000&
  MF_UNCHECKED = &H0
  End Enum
' ------------------------------------------------------------
  Private Const SC_CLOSE& = &HF060
  Private Const SC_RESTORE& = &HF120
' ------------------------------------------------------------
' ------------------------------------------------------------
' BOOL DeleteMenu(
'   HMENU hMenu,  // handle of menu
'   UINT  uItem,  // menu item identifier or position
'   UINT  fuFlags // menu item flag
' );
' ------------------------------------------------------------
  Private Declare Function apiDeleteMenu _
    Lib "user32" Alias "DeleteMenu" ( _
      ByVal hMenu As Long _
    , ByVal uItem As Long _
    , ByVal fuFlags As apiMF_Enum _
    ) As Long
' ------------------------------------------------------------
' BOOL DrawMenuBar(
'   HWND  hWnd  // handle of window with menu bar to redraw
' );
' ------------------------------------------------------------
  Private Declare Function apiDrawMenuBar _
    Lib "user32" Alias "DrawMenuBar" ( _
      ByVal hWnd As Long _
    ) As Long
' ------------------------------------------------------------
' int GetMenuItemCount(
'   HMENU hMenu // handle of menu
' );
' ------------------------------------------------------------
  Private Declare Function apiGetMenuItemCount _
    Lib "user32" Alias "GetMenuItemCount" ( _
      ByVal hMenu As Long _
    ) As Long
' ------------------------------------------------------------
' HMENU GetSystemMenu(
'   HWND hwnd,    // handle of window to own the System menu
'   BOOL fRevert  // reset flag
' );
' ------------------------------------------------------------
  Private Declare Function apiGetSystemMenu _
    Lib "user32" Alias "GetSystemMenu" ( _
      ByVal hWnd As Long _
    , ByVal fRevert As Long _
    ) As Long
' ============================================================
  Public Function RemoveMenuClose( _
    ByVal PopupAcForm As Access.Form _
  ) As Boolean
' ------------------------------------------------------------
  Dim lHMenu  As Long
  Dim lCount  As Long
' ------------------------------------------------------------
  With PopupAcForm
    If (.PopUp = True) Then
      lHMenu = apiGetSystemMenu(.hWnd, 0&)
      If (lHMenu <> 0) Then
        lCount = apiGetMenuItemCount(lHMenu)
        If (lCount <> 0) Then
          apiDeleteMenu lHMenu, lCount - 1, MF_BYPOSITION
          apiDeleteMenu lHMenu, lCount - 1, MF_BYPOSITION
          apiDrawMenuBar .hWnd
          RemoveMenuClose = True
        End If
      End If
    End If
  End With
  End Function
' ============================================================
    Nel modulo della maschera:
Private Sub Form_Load()
  RemoveMenuClose Me
End Sub
Private Sub Comando1_Click()
  DoCmd.Close
End Sub
--
Ciao :-)
Maurizio
--------
?SPQR(C)
 X
--------

 ha scritto nel messaggio
news:avfoe5$f034g$1...@ID-52090.news.dfncis.de...


 >     , ByVal fuFlags As apiMF_Enum _
    Sostituisci con:
        , ByVal fuFlags As Long


 CIAO.... francesco

 > principale.
    Scusa tu, invece... Avevi scritto chiaramente cosa volevi. Sono stato io
che mi sono fissato col pulsante di chiusura delle maschere invece che con
quello dell'applicazione... Cmq hai risolto, giusto?
