Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
Private Const WM_SETTEXT = &HC
Private Const WM_GETTEXT = &HD
Public Sub SetStartCaption(ByVal str As String)
Try
Dim StartBar As Integer
Dim StartBarText As Integer
Dim sCaption As String
StartBar = FindWindow("Shell_TrayWnd", vbNullString)
StartBarText = FindWindowEx(StartBar, 0&, "button", vbNullString)
sCaption = Mid(str, 1, 5)
SendMessageSTRING(StartBarText, WM_SETTEXT, 256, sCaption)
Catch ex As Exception
End Try
End Sub