Voila , j'ai crée un programme qui permet de changer le texte du bouton démmarrer sous windows XP. Il me faudrait maintenant récuperer ce texte, il faut que j'utilise la fonction "GetWindowText" mais le problème c'est que je suis un débutant en vb et si quelqu'un pouvait me mettre sur la voi se serait cool .
Voici la fonction :
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal nMaxCount As Integer) As Integer
Dim HwndWin As Long
'Obtenir le handle
HwndWin = FindWindow("Shell_TrayWnd", "")
HwndWin = FindWindowEx(HwndWin, 0, "BUTTON", 0)
D'après ce que donc je cherche le handle du menu démarrer, je l'ajoute et j'ajoute oci nMaxCount, ensuite il doit me sortit "démarrer' normalement mais cela ne fonctionne pas.
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" _
(ByVal hwnd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
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 Sub Command1_Click()
Dim HwndWin As Long
Dim lg As Long
Dim ch As String
HwndWin = FindWindow("Shell_TrayWnd", vbNullString)
HwndWin = FindWindowEx(HwndWin, 0, "BUTTON", vbNullString)
lg = GetWindowTextLength(HwndWin) + 1
ch = Space$(lg)
GetWindowText HwndWin, ch, lg
MsgBox ch