Option Compare Database
' *************
' Code Start
Option Explicit
Private Const GWL_STYLE = WS_EX_TRANSPARENT '(-16)
Private Const WS_CAPTION = &HC00000
Private Const SWP_NOSIZE = &H1
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
' **************************************************
'
Function AccessTitleBar(Show As Boolean) As Long
Dim hwnd As Long
Dim nIndex As Long
Dim dwNewLong As Long
Dim dwLong As Long
Dim wFlags As Long
hwnd = hWndAccessApp
nIndex = GWL_STYLE
wFlags = SWP_HIDEWINDOW + SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED
dwLong = GetWindowLong(hwnd, nIndex)
If Show Then
dwNewLong = (dwLong Or WS_CAPTION)
Else
dwNewLong = (dwLong And Not WS_CAPTION)
End If
Call SetWindowLong(hwnd, nIndex, dwNewLong)
Call SetWindowPos(hwnd, 0&, 0&, 0&, 0&, 0&, wFlags)
End Function
' Code End
' *************
'Sample calls
'To turn off title bar
'Call AccessTitleBar(False)
'
'To turn on title bar
'Call AccessTitleBar(True)