屏保程序有点问题,按照树上例子写的,没效果,大家看看怎么回事
function EnumProc(h:HWND;i:integer):boolean;stdcall;
var
buf:array[0..255] of char;
begin
GetWindowText(h,buf,sizeof(buf)-1);
if IsWindowVisible(h) then
Form1.ListBox1.Items.Add(strpas(buf)+intToStr(h))
else
Form1.ListBox1.Items.Add(strpas(buf)+inttostr(h));
result:=false;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FileListBox1.Directory:='D:\WINDOWS\system32';
end;
procedure TForm1.Freshl;
begin
listbox1.Clear;
enumChildWindows(Panel1.Handle,TFNWndEnumProc(@EnumProc),0);
end;
procedure TForm1.FileListBox1DblClick(Sender: TObject);
var
str:string;
begin
str:= FileListBox1.FileName+ inttostr(Panel1.Handle);//有问题
Edit1.Text:=str;
WinExec(pchar(str),SW_SHOW);
Freshl;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
h:integer;
s:string;
begin
if listBox1.ItemIndex=-1 then exit;
s:=listbox1.Items[listbox1.itemIndex];
h:=strToInt(copy(s,pos(':',s)+1,length(s)));
showWindow(h,SW_SHOW);
freshl;
end;
end.