Boa tarde amigos
Gostaria de saber se tem como ocultar os botões nativo (fechar, maximizar) do acesse 2019.
Estou usando esse código, mas ele só oculta o MINIMIZAR
Option Compare Database
Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_SYSMENU = &H80000
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Public Const SWP_FRAMECHANGED = &H20
Private Declare PtrSafe Function GetWindowLong _
Lib "user32" Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong _
Lib "user32" Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare PtrSafe 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
Public Function EscondeBotoes(Show As Boolean) As Long
Dim Janela As Long
Dim AtribueIndex As Long
Dim AtribueNovoLongo As Long
Dim AtribueLongo As Long
Janela = hWndAccessApp
AtribueIndex = GWL_STYLE
Const wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED + SWP_NOMOVE
Const FLAGS_COMBI = WS_MINIMIZEBOX Or WS_MAXIMIZEBOX Or WS_SYSMENU
AtribueLongo = GetWindowLong(Janela, AtribueIndex)
If Show Then
AtribueNovoLongo = (AtribueLongo Or FLAGS_COMBI)
Else
AtribueNovoLongo = (AtribueLongo And Not FLAGS_COMBI)
End If
Call SetWindowLong(Janela, AtribueIndex, AtribueNovoLongo)
Call SetWindowPos(Janela, 0&, 0&, 0&, 0&, 0&, wFlags)
End Function
Gostaria de saber se tem como ocultar os botões nativo (fechar, maximizar) do acesse 2019.
Estou usando esse código, mas ele só oculta o MINIMIZAR
Option Compare Database
Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_SYSMENU = &H80000
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Public Const SWP_FRAMECHANGED = &H20
Private Declare PtrSafe Function GetWindowLong _
Lib "user32" Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong _
Lib "user32" Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare PtrSafe 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
Public Function EscondeBotoes(Show As Boolean) As Long
Dim Janela As Long
Dim AtribueIndex As Long
Dim AtribueNovoLongo As Long
Dim AtribueLongo As Long
Janela = hWndAccessApp
AtribueIndex = GWL_STYLE
Const wFlags = SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED + SWP_NOMOVE
Const FLAGS_COMBI = WS_MINIMIZEBOX Or WS_MAXIMIZEBOX Or WS_SYSMENU
AtribueLongo = GetWindowLong(Janela, AtribueIndex)
If Show Then
AtribueNovoLongo = (AtribueLongo Or FLAGS_COMBI)
Else
AtribueNovoLongo = (AtribueLongo And Not FLAGS_COMBI)
End If
Call SetWindowLong(Janela, AtribueIndex, AtribueNovoLongo)
Call SetWindowPos(Janela, 0&, 0&, 0&, 0&, 0&, wFlags)
End Function