Fala aí pessoal, consegui descobrir na net, um código que desabilita o botão restaurar em um formulário maximizado, como procurei isto por bastante tempo e foi difícil achar, vou postar para todos poderem utilizar este recurso.
Option Explicit
Private Const WS_THICKFRAME As Long = &H40000
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 SetWindowPos Lib _
"user32" (ByVal hwnd As Long, ByVal _
hWndInsertAfter As Long, ByVal x As Long, _
ByVal y As Long, ByVal cx As Long, ByVal _
cy As Long, ByVal wFlags As Long) As Long
Function DisableResBtn(frm As Form)
Const WS_THICKFRAME = &H40000
Const WS_MAXIMIZE = &H1000000
Const WS_MAXIMIZEBOX = &H10000
Const GWL_STYLE = (-16)
Const SWP_FRAMECHANGED = &H20
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H4
'Const HWND_TOP = 0
Dim nStyle As Long
Dim hwnd As Long
nStyle = GetWindowLong(frm.hwnd, GWL_STYLE)
nStyle = nStyle And Not (WS_THICKFRAME)
nStyle = nStyle And Not (WS_MAXIMIZE)
nStyle = nStyle And Not (WS_MAXIMIZEBOX)
Call SetWindowLong(frm.hwnd, GWL_STYLE, nStyle)
SetWindowPos frm.hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER
End Function
================================================
No Evento Ao Carregar
Docmd.maximize
DisableResBtn Me.
Caco Sapo
Valeu. |