Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Top Part of Database Window

Status
Not open for further replies.

RLight4444

Programmer
Jun 13, 2002
3
US
I was asked to make changes to an existing database. The database windoww was partialy concealed by a toolbar (the title bar and the tables were hidden). I used windows > tile horizontally to expose the entire window. Now that I have completed my changes, I don't know how to hide the top part again. Any help would be appreciated.
 
Tools / Startup / Display Database Window

Untick

To redisplay DB Windows press F11 On On
Johnathan Perry
 
Thank you for your response, but that option doesn't solve my problem. That hides the entire database window. I need something that will leave most of the window visible, hiding only the top portion.
 
create a new module and past this code then call
RemoveAccessCaptionBar() in autoexec macro

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Option Compare Database

Option Explicit

' Store rectangle coordinates.
Type adhTypeRect
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type

Declare Function adh_apiGetWindowRect Lib "User32" Alias "GetWindowRect" (ByVal hWnd As Long, lpRect As adhTypeRect) As Long

Declare Function adh_apiGetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long

Declare Function adh_apiGetSystemMetrics Lib "User32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

Declare Function adh_apiMoveWindow Lib "User32" Alias "MoveWindow" (ByVal hWnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long

Declare Function adh_apiSetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Declare Function adh_apiGetWindow Lib "User32" Alias "GetWindow" (ByVal hWnd As Long, ByVal wCmd As Long) As Long

' GetWindowLong Constant
Public Const adhcGWL_STYLE = -16

' Windows Style constant
Public Const adhcWS_CAPTION = &HC00000

' System Metrics Constant
Public Const adhcSM_CYCAPTION = 4
Public Const adhcSM_CXFULLSCREEN = 16
Public Const adhcSM_CYFULLSCREEN = 17

Sub adhRemoveWindowCaptionBar(ByVal hWnd As Long)
Dim lngOldStyle As Long
Dim lngNewStyle As Long
Dim rct As adhTypeRect
Dim intDX As Integer, intDY As Integer

' Get the current window style of the form.
lngOldStyle = adh_apiGetWindowLong(hWnd, adhcGWL_STYLE)

' Turn off the bit that enables the caption.
lngNewStyle = lngOldStyle And Not adhcWS_CAPTION

' Set the new window style.
lngOldStyle = adh_apiSetWindowLong(hWnd, adhcGWL_STYLE, lngNewStyle)

' The caption's been removed, but now resize
' the whole window to match the size of the interior.

' Get the current size, including the caption.
adh_apiGetWindowRect hWnd, rct

' Calculate the new width and height.
intDX = rct.x2 - rct.x1
intDY = rct.y2 - rct.y1

' Move the window to the same left and top,
' but with new width and height.
' This will make the new form appear
' a little lower than the original.
Call adh_apiMoveWindow(hWnd, rct.x1, rct.y1, intDX, intDY, True)
End Sub

Public Function RemoveAccessCaptionBar()
Call adhRemoveWindowCaptionBar(Application.hWndAccessApp)
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top