Bonjour
Voila j'ai un handle sur un toolbar et j'aimerais pouvoir recuperer les ttoolbuttons associés à ce toolbar.
Un EnumChildWindows ne me renvoit rien, auriez-vous d'autres idées ?
Merci
Version imprimable
Bonjour
Voila j'ai un handle sur un toolbar et j'aimerais pouvoir recuperer les ttoolbuttons associés à ce toolbar.
Un EnumChildWindows ne me renvoit rien, auriez-vous d'autres idées ?
Merci
Moi, je ferais quelque chose du genre...
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 hWnd:THandle; FindCtrl:TWinControl; i:integer; begin hWnd:=ToolBar1.handle; // prend le hWnd du toolbars //Retrouve un pointeur vers la toolbar FindCtrl:=FindControl(hWnd); if FindCtrl<>nil then begin with FindCtrl as TToolBar do begin //Pour chaque bouton... recuperation du nom... for i:=0 to ButtonCount-1 do begin Memo1.Lines.Add(Buttons[i].Name); end end; end; end;