Private Declare Function IsWindowUnicode Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Function SetWindowTextW Lib "user32.dll" (ByVal hWnd As Long, ByVal lpString As Long) As Long
Private Declare Function SetWindowTextA Lib "user32.dll" (ByVal hWnd As Long, ByVal lpString As String) As Long
If IsWindowUnicode(m_hWnd) Then
If Len(sText) = 0 Then
SetWindowTextW m_hWnd, StrPtr(vbNullString)
Exit Sub
End If
lPtr = StrPtr(sText)
SetWindowTextW m_hWnd, lPtr
Else
If Len(sText) = 0 Then
SetWindowTextA m_hWnd, vbNullString
Exit Sub
End If
SetWindowTextA m_hWnd, sText
End If