General |
6.32 Rimuovere il pulsante di chiusura (X), il menu e i pulsanti di ridimensionamento di Access. |
AntoGal |
Private Const GWL_STYLE = -16 Private Const WS_SYSMENU = &H80000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_MAXIMIZEBOX = &H10000 Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _ (ByVal hwnd As Long, ByVal nIndex As Long) As Long 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 GetParent Lib "user32" (ByVal hwnd As Long) As Long Public Sub LockAppWindow(fForm As Form) ModifyAppWind fForm.hwnd MsgBox "Ciao ciao pulsantini!" End Sub Private Sub ModifyAppWind(wChildWnd) Dim wParentWnd As Long wParentWnd = GetParent(GetParent(wChildWnd)) Dim PrevWinStyle As Long, NewWinStyle As Long PrevWinStyle = GetWindowLong(wParentWnd, GWL_STYLE) NewWinStyle = PrevWinStyle And Not WS_SYSMENU And _ Not WS_MINIMIZEBOX And _ Not WS_MAXIMIZEBOX PrevWinStyle = SetWindowLong(wParentWnd, GWL_STYLE, NewWinStyle) End SubLa funzione va richiamata così: LockAppWindow Screen.ActiveForm |