用户名: 密码: 验证码:           网站地图  高级搜索  RSS订阅  收藏本站
您的位置:主页 > 程序编程 > Delphi >

Delphi开发98屏幕保护预览程序

[ 来源:论坛 | 作者:delphifans | 更新日期:2008-3-23 14:14:44 | 人气: | 评论 0 条 ]


unitUnit1;

interface

uses
Windows,Messages,SysUtils,Classes,
Graphics,Controls,Forms,Dialogs,
StdCtrls,FileCtrl,ExtCtrls,Menus;

type
TForm1=class(TForm)
Panel1:TPanel;
Panel2:TPanel;
FileListBox1:TFileListBox;
ListBox1:TListBox;
PopupMenu1:TPopupMenu;
Hide1:TMenuItem;
Show1:TMenuItem;
Close1:TMenuItem;
procedureFormCreate(Sender:TObject);
procedureFileListBox1DblClick(Sender:TObject);
procedureHide1Click(Sender:TObject);
procedureShow1Click(Sender:TObject);
procedureClose1Click(Sender:TObject);
private
{Privatedeclarations}
public
{Publicdeclarations}
procedureFresh1;
end;

var
Form1:TForm1;

implementation

{$R*.DFM}
functionEnumProc(
h:HWND;//handleofchildwindow
l:integer//application-definedvalue
):boolean;stdcall;
文章来源于www.hot007.com

varbuf:array[0..255]ofchar;
begin
GetWindowText(h,buf,sizeof(buf)-1);
ifiswindowvisible(h)then
Form1.ListBox1.items.add
('' strpas(buf) ':' inttostr(h))
else
Form1.ListBox1.items.add
('-' strpas(buf) ':' inttostr(h));
Result:=true;
end;

procedureTForm1.Fresh1;
begin
ListBox1.clear;
enumChildwindows(Panel2.handle,
TFNWndEnumProc(@enumproc),0);
end;

procedureTForm1.FormCreate(Sender:TObject);
varbuf:array[0..256]ofchar;
begin
GetSystemDirectory(buf,sizeof(buf)-1);
FileListBox1.directory:=strpas(buf);
ListBox1.popupmenu:=Popupmenu1;
end;

procedureTForm1.FileList
Box1DblClick(Sender:TObject);
begin
WinExec(pchar(FileListBox1.FileName
'/p' inttostr(Panel2.handle)),
SW_Show);
Fresh1;
end;

procedureTForm1.Hide1Click(Sender:TObject);
varh:integer;
s:string;
begin
ifListBox1.itemindex=-1thenexit;
s:=Listbox1.items[ListBox1.itemindex]; www.jc567.cn
h:=strtoint(copy(s,pos(':',s) 1,length(s)));
ShowWindow(h,SW_HIDE);
Fresh1;
end;

procedureTForm1.Show1Click(Sender:TObject);
varh:integer;
s:string;
begin
ifListBox1.itemindex=-1thenexit;
s:=Listbox1.items[ListBox1.itemindex];
h:=strtoint(copy(s,pos(':',s) 1,length(s)));
ShowWindow(h,SW_SHOW);
Fresh1;
end;

procedureTForm1.Close1Click(Sender:TObject);
varh:integer;
s:string;
begin
ifListBox1.itemindex=-1thenexit;
s:=Listbox1.items[ListBox1.itemindex];
h:=strtoint(copy(s,pos(':',s) 1,length(s)));
PostMessage(h,WM_QUIT,0,0);
Fresh1;
end;

end.



共2页: 上一页 [1] 2 下一页
Tags:Delphi开发98屏幕保护预览程序
您的评论
用户名: 新注册) 密码: 匿名评论 [所有评论]

·用户发表意见仅代表其个人意见,并且承担一切因发表内容引起的纠纷和责任
·本站管理人员有权在不通知用户的情况下删除不符合规定的评论信息或留做证据
·请客观的评价您所看到的资讯,提倡就事论事,杜绝漫骂和人身攻击等不文明行为