function EnumChildWindowsProc(H: HWnd; lparam: longint): Boolean; stdcall;
var
s: string;
EditText: array[0..255] of char;
begin
Result := True;
SetLength(s, 255);
GetClassName(h, PChar(s), 255);
if Pos('TZEDITOR', UpperCase(s)) > 0 then //TZEditor即为那个编辑控件的类名。
begin
SendMessage(h, WM_GETTEXT, 255, LongInt(@EditText));
//我记得 edit 和其他不一样,好象不能用 WM_GETTEXT
// 用什么忘了。
Form1.RichEdit1.Lines.Add(EditText);
Result := false;
end;
end;
function FindFoxMailWindow: THandle;
var
FoxMailWindowHandle: THandle;
begin
FoxMailWindowHandle := FindWindow('TF_compose', nil); //TF_compost为邮件编辑窗口的类名。
if FoxMailWindowHandle <> 0 then
begin
EnumChildWindows(FoxMailWindowHandle, @EnumChildWindowsProc, 0);
end;
Result := FoxMailWindowHandle;
end;begin
FindFoxMailWindow;
end;好像对TZEDITOR属性无法使用SendMessage
请各位帮忙!
var
s: string;
EditText: array[0..255] of char;
begin
Result := True;
SetLength(s, 255);
GetClassName(h, PChar(s), 255);
if Pos('TZEDITOR', UpperCase(s)) > 0 then //TZEditor即为那个编辑控件的类名。
begin
SendMessage(h, WM_GETTEXT, 255, LongInt(@EditText));
//我记得 edit 和其他不一样,好象不能用 WM_GETTEXT
// 用什么忘了。
Form1.RichEdit1.Lines.Add(EditText);
Result := false;
end;
end;
function FindFoxMailWindow: THandle;
var
FoxMailWindowHandle: THandle;
begin
FoxMailWindowHandle := FindWindow('TF_compose', nil); //TF_compost为邮件编辑窗口的类名。
if FoxMailWindowHandle <> 0 then
begin
EnumChildWindows(FoxMailWindowHandle, @EnumChildWindowsProc, 0);
end;
Result := FoxMailWindowHandle;
end;begin
FindFoxMailWindow;
end;好像对TZEDITOR属性无法使用SendMessage
请各位帮忙!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货