'Steffen Geberth CIS 100145,1210
Option Compare Database   'Verwenden der Datenbank-Sortierreihenfolge beim Vergleich von Zeichenfolgen.
Option Explicit
Declare Sub xAPISetWindowText Lib "User" Alias "SetWindowText" (ByVal h%, ByVal lpstr$)
----------------------------------------
Sub ChangeTitleOfActiveWindow (Caption$)
On Error Resume Next
Dim hw As Integer
hw = Screen.ActiveForm.HWND
On Error GoTo ERR_SetActiveTitle
Call xAPISetWindowText(hw, Caption$)
EXIT_SetActiveTitle:
Exit Sub

ERR_SetActiveTitle:
    MsgBox Error
    Resume EXIT_SetActiveTitle
    
End Sub

Function SetTitle ()
On Error Resume Next
Dim HWND As Integer
HWND = wu_GetAccessHwnd()
'hwnd = wu_GetCurrentDoc(False)
'hwnd = Screen.ActiveForm.hwnd
On Error GoTo ERR_xChangeFormCaption
Call xAPISetWindowText(HWND, SelFullName())
EXIT_xChangeFormCaption:
Exit Function

ERR_xChangeFormCaption:
    MsgBox Error
    Resume EXIT_xChangeFormCaption

End Function

