D
dngjzx
Unregistered / Unconfirmed
GUEST, unregistred user!
请帮我个忙,帮我写个去除IE标题栏中的程序名称的代码,我刚学D什么都不懂请多帮帮
要求:在Edit1中显示去除程序名后的标题
function EnumChildWindowsProc(hwnd: Integer; lparam: Longint): Boolean; stdcall;
var
buffer: array[0..255] of char;
begin
Result := True;
GetClassName(hwnd,buffer,256);
if StrPas(Buffer)='Edit' then
begin
SendMessage(hwnd,WM_GETTEXT,256,lparam);
Result:=False;
end;
end;
procedure TForm1.FormActivate(Sender: TObject);
var
hwnd: Integer;
buffer: array[0..255] of char;
begin
hwnd := FindWindow('IEFrame',nil);
if hwnd<> 0 then
begin
EnumChildWindows(hwnd,@EnumChildWindowsProc,Integer(@buffer[0]));
edit2.Text:=(StrPas(buffer));
GetWindowText(hwnd,buffer,256);//取标题栏
edit1.Text:=(strpas(buffer));
end;
end;
要求:在Edit1中显示去除程序名后的标题
function EnumChildWindowsProc(hwnd: Integer; lparam: Longint): Boolean; stdcall;
var
buffer: array[0..255] of char;
begin
Result := True;
GetClassName(hwnd,buffer,256);
if StrPas(Buffer)='Edit' then
begin
SendMessage(hwnd,WM_GETTEXT,256,lparam);
Result:=False;
end;
end;
procedure TForm1.FormActivate(Sender: TObject);
var
hwnd: Integer;
buffer: array[0..255] of char;
begin
hwnd := FindWindow('IEFrame',nil);
if hwnd<> 0 then
begin
EnumChildWindows(hwnd,@EnumChildWindowsProc,Integer(@buffer[0]));
edit2.Text:=(StrPas(buffer));
GetWindowText(hwnd,buffer,256);//取标题栏
edit1.Text:=(strpas(buffer));
end;
end;