主题:这个程序运行的时候错误,怎么回事啊?
这个程序运行的时候错误,怎么回事啊?
var
hcurrentwindow:hwnd;
sztext:array[0..254]of char;
gao:array [0..200] of string;
i:integer;
begin
listbox1.Items.Clear;
hcurrentwindow:=GetForegroundWindow;
while hcurrentwindow <> 0 do
begin
if getwindowtext(hcurrentwindow,@sztext,254) > 0 then
listbox1.Items.Add(inttostr(hcurrentwindow)+':'+strpas(@sztext));
hcurrentwindow:=GetNextWindow(hcurrentwindow,gw_hwndnext);
gao[i]:=sztext[1]+sztext[2]+sztext[3]+sztext[4]+sztext[5];
inc(i);
end;
end;[em8][em8]
var
hcurrentwindow:hwnd;
sztext:array[0..254]of char;
gao:array [0..200] of string;
i:integer;
begin
listbox1.Items.Clear;
hcurrentwindow:=GetForegroundWindow;
while hcurrentwindow <> 0 do
begin
if getwindowtext(hcurrentwindow,@sztext,254) > 0 then
listbox1.Items.Add(inttostr(hcurrentwindow)+':'+strpas(@sztext));
hcurrentwindow:=GetNextWindow(hcurrentwindow,gw_hwndnext);
gao[i]:=sztext[1]+sztext[2]+sztext[3]+sztext[4]+sztext[5];
inc(i);
end;
end;[em8][em8]