Amigos boa tarde peço se possível uma ajuda pra resolver esse problema, estou usando este código para ocultar os botões Minimizar, Maximizar e Fechar do Banco de Dados Acesse. O mesmo funcionar perfeitamente no acesse 2010 só que no acesse 2019 não, apena ocultar o Minimizar, onde está o erro?
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 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
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
chamndondo a função no abri do formualrio
Private Sub Form_Open(Cancel As Integer)
Call EscondeBotoes(False)
End Sub
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 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
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
chamndondo a função no abri do formualrio
Private Sub Form_Open(Cancel As Integer)
Call EscondeBotoes(False)
End Sub