Autor Beitrag
SatBL
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Di 25.11.03 15:53 
Hallo,

ich habe nun schon das halbe Forum durchgelesen, aber leider noch nichts zu meinen Problem gefunden, vieleicht kann mir jemand weiter helfen.
Mein Progrämmchen soll einen ToolButton in einem Fremden Programm betätigen. Leider bekomme ich den Handle dafür nicht.

Hier mein Bsp. Prg.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TfrmMain.Button1Click(Sender: TObject);
var MFwnd, hTb, hTbb: HWND;
begin
  MFwnd:= FindWindow(pChar('TFormMain'),nil);
  hTb:= FindWindowEx(MFwnd,0,'TToolbar',nil);   
  hTbb:= FindWindowEx(hTb,0,nil,'ToolButton14');

  PostMessage(htbb, BM_CLICK, 0, 0);
end;


Für hTb bekomme ich den Handle, aber bei hTbb bekomme ich immer 0 zurück.

Was mache ich falsch???
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 25.11.03 18:29 
Du hast ein Programm in dem der Toolbar-Button mit 'ToolButton14' beschriftet ist?
SatBL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Di 25.11.03 18:36 
Hallo Luckie,

genau, in dem Programm was ich steuern möchte gibt es ein ToolBar und dort ist ein ToolButton14 drin.
Chris1308
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220

Win XP Prof.
D2005 Prof, D7 Prof, D7 Pers
BeitragVerfasst: So 30.11.03 19:41 
Hi,
versuch beim Handle der Toolbar mal die Caption anstatt nil zu verwenden.

Chris
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 30.11.03 21:36 
Also falls das ein Delphi-Programm mit einem TToolButton ist - TToolButton ist von TGraphicControl abgeleitet und nicht von TWinControl und hat folglich auch kein Handle da es kein "Fenster" ist..!

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
SatBL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Di 02.12.03 22:08 
Hallo,
ja es sind beides Delphi Programme, und da ich jetzt schon alle Möglichenkeiten durch habe, denke ich das Motzi wohl recht hat ;-)

Danke trotzdem noch mal an alle.