Registriert seit: 29. Mai 2002
37.621 Beiträge
Delphi 2006 Professional
|
Re: anderes program auslesen
2. Apr 2007, 21:51
Wenn es nur eine MessageBox ist:
Delphi-Quellcode:
function GetMessageBoxTextByCaption(const Caption: String): String;
const
ID_STATIC = $0000FFFF;
var
hMsgBox: THandle;
len: Integer;
Buffer: PChar;
begin
hMsgBox := FindWindow(nil, PChar(Caption));
if hMsgBox <> 0 then
begin
len := SendMessage(GetDlgItem(hMsgBox, ID_STATIC), WM_GETTEXTLENGTH, 0, 0);
if len > 0 then
begin
GetMem(Buffer, len + 1);
try
GetDlgItemText(hMsgBox, ID_STATIC, Buffer, len + 1);
SetString(Result, Buffer, len + 1);
finally
FreeMem(Buffer);
end;
end;
end;
end;
Michael Ein Teil meines Codes würde euch verunsichern.
|
|
Zitat
|