屏保程序有点问题,按照树上例子写的,没效果,大家看看怎么回事
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.
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.
...全文
相关推荐
自己制作简单的屏保程序
自己制作的简单的屏保程序,可以随意修改,有喜欢的欢迎下载。
delphi写的屏保程序
delphi写的屏保程序,解决了移动鼠标关闭屏保的问题。
一个用VC写的屏保程序
一个用VC写的屏保程序,文字会不断变换色彩,很漂亮的!
VB屏保例子,设置时间、禁止和开启屏保源码.rar
一款屏幕保护的示例程序,可以设置屏保时间,该实例中还可以设置禁止和开启屏幕保护,VB与系统相关的小例子,新手学习一下,不错。
4个漂亮的屏保程序-粒子屏保 水蒸汽屏保 屏保之绚彩花火 夜光时钟屏保
粒子屏保KaleidoMorph.scr 水蒸汽屏保smoke.scr 屏保之绚彩花火.scr 夜光时钟屏保.SCR


Windows SDK/API
