Autor Beitrag
Talbot
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win 2000, Win98, WinXP Prof, Linux(Suse, Gentoo, Debian, RedHat)
D6 Enterprise
BeitragVerfasst: Mi 19.05.04 11:01 
Hi!
Ich hab ein Programm, das mir Prozessnamen und die dazugehöhrige ProcessID in Dezimal ausgibt. Welcher Befehl ist nötig um das zur ProcessID passende Windowhandle in Erfahrung zu bringen?
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 19.05.04 11:51 
Da gibt es keinen Befehl. Ein prozess kann ja durch aus mehrere Fenster haben. Was soll dir da die Funktion zurück geben? Es gibt nur eine Möglichkeit mittels:
Zitat:

The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.

für alle Fenster zu ermitteln und mit der gewünschten ProzessID zu vergleich.
Talbot Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win 2000, Win98, WinXP Prof, Linux(Suse, Gentoo, Debian, RedHat)
D6 Enterprise
BeitragVerfasst: Mi 19.05.04 11:57 
Na gut.
Gehn wirs anders an.
Ich will den PageFileUsage von einem Process auslesen.
wenn ich das mit
ausblenden Delphi-Quelltext
1:
Win32Check(GetProcessMemoryInfo(GetCurrentProcess, @aPMC, sizeOf(aPMC)));					

mache, dann krieg ich nur den Speicherverbrauch von meinem Programm.
Wenn ich jetz aber ne Liste mit Prozessnamen und ID als Vorgabe habe, wie geh ich dann vor?
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 19.05.04 12:19 
Ja, wenn du die ProzessID hast.... ???? Wo ist das Problem?

Ich glaube, ich habe dein Problem erkannt: Code ohne Sinn und Verstand kopiert.

Rat mal, wozu wohl der erte Parameter von Win32Chekc (was auch immer das ist) gut ist bzw. angibt. :roll:
Talbot Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win 2000, Win98, WinXP Prof, Linux(Suse, Gentoo, Debian, RedHat)
D6 Enterprise
BeitragVerfasst: Mi 19.05.04 12:59 
Das Problem liegt darin, dass der mir sagt, (wenn ich die Prozess ID angeb) "ungültiges handle"
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mi 19.05.04 16:40 
Du brauchst auch ein Process-Handle statt einer ProcessID.. siehe dazu Suche im MSDN OPENPROCESS

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!