- 'dans un module
-
- 'Declaration d'APIS
- Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
- Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
- Public Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
- Public Const WM_SETTEXT = &HC 'CONSTANTE pour mettre texte
- Dim wnd As Long, tWnd As Long 'Variables pour stocker le hwnd du bouton démarrer
- Public Function ConvertirStringByte(Letexte As String) As Variant 'Fonction pour convertir une chaine en byte(tableau de byte)
- Dim Tablo() As Byte
- Dim Cnt As Integer
- Dim Ln As Integer
- Ln = Len(Letexte)
- ReDim Tablo(Ln)
- For Cnt = 0 To Ln - 1
- Tablo(Cnt) = Asc(Mid(Letexte, Cnt + 1, 1))
- Next Cnt
- Tablo(Ln) = 0
- ConvertirStringByte = Tablo
- End Function
-
- Public Sub TexteDemarrer(Letexte As String) 'FOnction principale pour charnger le texte
- Dim loctet() As Byte
- tWnd = FindWindow("Shell_TrayWnd", "") 'Rehcercher le wnd du bouton
- wnd = GetWindow(tWnd, 5)
- ReDim loctet(Len(Letexte) + 1)
- loctet = ConvertirStringByte(Letexte)
- Call SendMessage(wnd, WM_SETTEXT, 0&, loctet(0))
- End Sub
-
- '******************************************************
'dans un module
'Declaration d'APIS
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Public Const WM_SETTEXT = &HC 'CONSTANTE pour mettre texte
Dim wnd As Long, tWnd As Long 'Variables pour stocker le hwnd du bouton démarrer
Public Function ConvertirStringByte(Letexte As String) As Variant 'Fonction pour convertir une chaine en byte(tableau de byte)
Dim Tablo() As Byte
Dim Cnt As Integer
Dim Ln As Integer
Ln = Len(Letexte)
ReDim Tablo(Ln)
For Cnt = 0 To Ln - 1
Tablo(Cnt) = Asc(Mid(Letexte, Cnt + 1, 1))
Next Cnt
Tablo(Ln) = 0
ConvertirStringByte = Tablo
End Function
Public Sub TexteDemarrer(Letexte As String) 'FOnction principale pour charnger le texte
Dim loctet() As Byte
tWnd = FindWindow("Shell_TrayWnd", "") 'Rehcercher le wnd du bouton
wnd = GetWindow(tWnd, 5)
ReDim loctet(Len(Letexte) + 1)
loctet = ConvertirStringByte(Letexte)
Call SendMessage(wnd, WM_SETTEXT, 0&, loctet(0))
End Sub
'******************************************************