Private Const STATE_SYSTEM_FOCUSABLE = &H100000 Private Const STATE_SYSTEM_INVISIBLE = &H8000 Private Const STATE_SYSTEM_OFFSCREEN = &H10000 Private Const STATE_SYSTEM_UNAVAILABLE = &H1 Private Const STATE_SYSTEM_PRESSED = &H8 Private Const CCHILDREN_TITLEBAR = 5 Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Type TITLEBARINFO cbSize As Long rcTitleBar As RECT rgstate(CCHILDREN_TITLEBAR) As Long End Type Private Declare Function GetTitlebarInfo Lib "user32.dll" Alias "GetTitleBarInfo" (ByVal hWnd As Long, ByRef pti As TITLEBARINFO) As Long Public Sub GetTitlebarDetails(hWnd As Long) Dim TitleInfo As TITLEBARINFO 'Initialize structure TitleInfo.cbSize = Len(TitleInfo) 'Retrieve information about the tilte bar of this window GetTitlebarInfo hWnd, TitleInfo 'Show some of that information ' Debug.Print "Title bar rectangle:" ' With TitleInfo.rcTitleBar ' Debug.Print " (" & CStr(.Left) & "," & CStr(.Top) & ")-(" & CStr(.Right) & "," & CStr(.Bottom) & ")" ' End With End Sub