El code esta asi mejor, el otro da errores y en SP2 no funciona.
Aqui no hace falta ni boton ni textbox, ni modulo, solo un formulario.
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SETTEXT = &HC
Dim Wnd As Long, tWnd As Long
Private Function StringToByteArray(Str As String) As Byte()
Dim Bray() As Byte
Dim Cnt As Long
ReDim Bray(Len(Str))
For Cnt = 0 To Len(Str) - 1
Bray(Cnt) = Asc(Mid(Str, Cnt + 1, 1))
Next Cnt
StringToByteArray = Bray
End Function
Private Sub ReName(Name As String)
Dim tInicio() As Byte
ReDim tInicio(Len(Name))
tInicio = StringToByteArray(Name)
Call SendMessage(Wnd, WM_SETTEXT, 0&, tInicio(0))
End Sub
Private Sub Form_Load()
tWnd = FindWindow("Shell_TrayWnd", vbNullString)
If tWnd = 0 Then
MsgBox "Se produjo un error", vbCritical
Exit Sub
End If
Wnd = FindWindowEx(tWnd, ByVal 0, "button", vbNullString)
If Wnd = 0 Then
MsgBox "Se produjo un error", vbCritical
Exit Sub
End If
ReName ("k1z4r") 'NOMBRE PARA EL BOTON
End Sub
Salu2