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开发的浏览器支持IPv6?
- sql server c/s系统问题
- 在线等待,答对马上给分。关于qreport的问题
- 怎末做office2000风格菜单?
- 需求最好解决算法
- 如何用delphi调用poweroint?
- 一个关于DateTimePicker的问题
- delphi中函数调用的问题?
- 老千,你在吗?偶用wise已经初装好了,不过,还有一个不明白的地方:偶想生成一个readme文件在安装文件里,不知道应该在哪里添加?另外安装文件里有一个 installl.txt 文件,他是什么?//牛虻
- 给出相关参数怎么画圆锥,圆台?100分求救!!!
- 请各位帮我解决一下SQL SERVER 2000 与DELPHI 的连接问题(谢先)---急,在线等
Edit1.Text:=str;
WinExec(pchar(str),SW_SHOW);
这是什么意思?winexec要文件的路径和文件名,不用inttostr(Panel1.Handle)这个。
另外启动屏保可以直接用SendMessage(HWND_BROADCAST,WM_SYSCOMMAND,SC_SCREENSAVE,0);
启动屏保方法很多
uses shellapi;shellexecute(handle,nil,pchar(filename),nil,nil,sw_show);
filename为屏保文件名(绝对路径)