Autor Beitrag
hawe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Do 02.12.04 15:26 
hoi,

Ich habe das Problem, dass ich ein fremdes Programm in den Vordergrund holen will. Das
geht einerseits mit einem Klick auf das Tray-Icon des Programms (das Programm läuft nur
als Tray-Icon) *oder* mit einem Aktivieren des Hauptformulars.

1. das Aktivieren des Hauptformulars mache ich mit
ShowWindow(hMainForm, SW_RESTORE); (oder auch andere SW_s)
das Problem dabei: das Minimieren geht nicht mehr, da das Programm wohl intern noch denkt
es sei schon minimiert (ist bei anderen Programmen übrigens auch so).

2. das Klicken auf das Tray-Icon funktioniert nicht, weil ich das Handle desselben nicht kenne.
Wie kann ich das herausfinden? Ich könnte das Handle der Application, des Exenamens u.ä. anbieten.

1000 Dank
hawe-
herzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 168

WINXP pro, SUSE Linux 9.0
D7 Pers.
BeitragVerfasst: Fr 03.12.04 19:30 
Hier im DF gibts das Tool Winspy, das ist auch der Zugriff auf TrayIcons mit dabei.

Ich würde mal den Programmierer fragen, wie er das gemacht hat
hawe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Fr 03.12.04 21:39 
hej,

ja, Winspy habe ich eingesetzt, um das Handle anderer Fenster herauszubekommen,
jedoch hat es immer den Tray als einen Bereich angezeigt.

Mittlerweile (stundenlanges Ausprobieren) habe ich nun die 1. Lösung verfeinert
und mit SetWindowPos (soweit ich mich erinnere) losgelegt.

Danke,
hawe-