屏保程序有点问题,按照树上例子写的,没效果,大家看看怎么回事

holyelle holyelle 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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.
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
holyelle
Windows SDK/API 1,184 成员 22,326 内容