Autor Beitrag
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Fr 12.09.08 14:54 
OK. Ich teste es nachher. Aber nochmal ne andere Frage:

Die Titelleiste vom DOS Fenster ist ja nicht immer gleich. Kann ich die Titelleiste nicht auch dynamisch bekommen ?

Also ein Handle vom aktuell aktiven Fenster bestimmen ? Geht das mit Delphi ?
Boldar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: Fr 12.09.08 14:55 
ich glaube
ausblenden Delphi-Quelltext
1:
getactivewindow					

ermittelt das oberste Fenster

EDIT: die Schweizer sagen dazu das hier
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Fr 12.09.08 15:24 
Mhm, aus dem schweizerischen Artikel kann ich aber nicht so richtig viel rauslesen. Ich kann zwar ein Handle bekommen, welches ein bestimmtes Keyword enthält, aber leider können ja auch mehrere CMD Fenster geöffnet sein, oder nicht ?

Die Frage ist, wie ich das bekomme, in dem sich der User gerade befindet ?
oder habe ich da was überlesen ?

Edit: Ich habe es mal mit ForceForegroundWindow (siehe hier: 64.233.183.104/searc...mp;client=firefox-a) probiert, da GetActiveWindow laut Google nicht das richtige Ergebnis liefert. Aber geht irgendwie nicht.

Bin relativ ratlos :(
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Fr 12.09.08 15:46 
Also:
Ich habe es scheinbar nun doch hingebogen ;) Mit GetForegroundWindow geht es:
ausblenden Delphi-Quelltext
1:
SendMessage(GetForegroundWindow, WM_CHAR, Ord('s'), 0);					


Nur weiß ich nicht, was der Unterschied zwischen GetForegroundWindow und GetActiveWindow ist !?
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Fr 12.09.08 16:32 
user profile iconLonghornUser hat folgendes geschrieben:
Nur weiß ich nicht, was der Unterschied zwischen GetForegroundWindow und GetActiveWindow ist !?

RTFM.

Zitat:
The GetActiveWindow function retrieves the window handle to the active window attached to the calling thread's message queue.


Zitat:
The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working).

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Fr 12.09.08 18:40 
Ist ja gut, beruhige dich wieder.

Vielen vielen Dank an alle !!!