unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
function EnumChildWindowsProc(hwnd: Integer; lparam: Longint): Boolean; stdcall;
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(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])); //这里出错了(第37行),Integer(@buffer[0])需要参数?
memo1.Lines.Add(StrPas(buffer));
GetWindowText(hwnd,buffer,255);
memo1.Lines.Add(strpas(buffer));
end;
end;
function TForm1.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;
end.[Error] Unit1.pas(37): Variable required
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
function EnumChildWindowsProc(hwnd: Integer; lparam: Longint): Boolean; stdcall;
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(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])); //这里出错了(第37行),Integer(@buffer[0])需要参数?
memo1.Lines.Add(StrPas(buffer));
GetWindowText(hwnd,buffer,255);
memo1.Lines.Add(strpas(buffer));
end;
end;
function TForm1.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;
end.[Error] Unit1.pas(37): Variable required
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
解决方案 »
- 请问在D7里面如何安装报表啊?
- 怎样把double变为string??
- 有关sql语句出现的问题?
- 要做个东西类似filemon,把用户对文件操作的情况记录进数据库……
- Delphi 6 + Sqlserver ,三层结构,但是安装后服务端总是报Stack Overflow,什么原因,咋解决?
- 关于字符ASCII码转换的问题,在线等候,急!
- 请教各位老师:我在窗口上,加了一个按钮,然后。。。。。
- 小小尿:一个”查询“按钮,想改成用ADOTABle控制数据库。
- 哪儿有BDE驱动程序安装包?
- 哪有borland公司出版的delphi6开发指南的书
- CS模式的Win32数据库应用软件基于Internet运行时套接字的作用
- CReport用法
这个函数别定义为类的成员函数,定义为全局函数
function TForm1.EnumChildWindowsProc(hwnd: Integer; lparam: Longint): Boolean; stdcall;
这样?
function EnumChildWindowsProc(hwnd: Integer; lparam: Longint): Boolean; stdcall;