Option Explicit
#If VBA7 Then
Private Declare ptrsafe Function fwa Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longptr
Private Declare ptrsafe Function SetWindowLongA Lib "user32" (ByVal hwnd As Longptr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Longptr
Dim handle As longptr
#Else
Private Declare Function fwa Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim handle As Long
#End If
Private Sub UserForm_Activate()
handle = fwa(vbNullString, Me.Caption)
SetWindowLongA handle, -16, &H94CF0080 'complete caption
End Sub