Autor Beitrag
hallo
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 450

WIN XP, SuSE 9.3
D3 Prof, D6 Pers, 2005 Pers
BeitragVerfasst: Di 20.07.04 14:09 
Hi,

wie kann ich wenn ich das Handle eines Fensters hab, die Caption dazu rausfinden?

PS Hab schon im Forum gesucht, aber nichts gefunden

_________________
Der beste je Programmierte Trojaner: Windows XP
Wäre es nicht adequat, den Usus heterogener Termini zu minimieren?
Viper
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 88



BeitragVerfasst: Di 20.07.04 14:15 
Das geht mit der function GetWindowText.
hier ein Auszug aus der PSDK:
Zitat:

Syntax

int GetWindowText(
HWND hWnd,
LPTSTR lpString,
int nMaxCount
);

Parameters
hWnd
[in] Handle to the window or control containing the text.
lpString
[out] Pointer to the buffer that will receive the text. If the string is as long or longer than the buffer, the string is truncated and terminated with a NULL character.
nMaxCount
[in] Specifies the maximum number of characters to copy to the buffer, including the NULL character. If the text exceeds this limit, it is truncated.

Return Value
If the function succeeds, the return value is the length, in characters, of the copied string, not including the terminating NULL character. If the window has no title bar or text, if the title bar is empty, or if the window or control handle is invalid, the return value is zero. To get extended error information, call GetLastError.
This function cannot retrieve the text of an edit control in another application.


_________________
"Der Sinussatz ist nur was für Leute, die Teichbesitzer mit Insel und Baum sind. Alle anderen können ihn vergessen" (Mein Mathe-Prof.)
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Di 20.07.04 14:15 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
var Buf:array[0..1024of Char;
begin
 GetWindowText(Handle,Buf,SizeOf(Buf));
 ShowMessage(StrPas(Buf));


//Edit: Verdammt schon wieder zu langsam :cry:

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Viper
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 88



BeitragVerfasst: Di 20.07.04 14:22 
mach dir nix raus, dafür hat er jetzt sogar noch ein Beispiel!

_________________
"Der Sinussatz ist nur was für Leute, die Teichbesitzer mit Insel und Baum sind. Alle anderen können ihn vergessen" (Mein Mathe-Prof.)
hallo Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 450

WIN XP, SuSE 9.3
D3 Prof, D6 Pers, 2005 Pers
BeitragVerfasst: Mi 21.07.04 14:12 
DANKE FÜR DIE ANTWORTEN!

Das war ja ein ganz kurzer Code! ;-)
Ich hab gedacht der wäre länger!
ALSO NOCHMALS VIELEN DANK!

_________________
Der beste je Programmierte Trojaner: Windows XP
Wäre es nicht adequat, den Usus heterogener Termini zu minimieren?