⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 我的delphi中公共function(2) (2001年1月2日).txt

📁 自己对DELPHI学习的一点体会
💻 TXT
字号:
我的delphi中公共function(2) (2001年1月2日) 

网友更新  分类:杂类   作者: saoren(推荐)  推荐:saoren   阅读次数:631  
(http://www.codesky.net)  

--------------------------------------------------------------------------------
uses FileCtrl,stdCtrl;

//得到Dir目录中,mask条件(*.exe;*.mdb)的文件,存放到List
Procedure GetDirectoryFile(Owner:TForm;List:TStrings;Dir,Mask:string);
var File1:TFileListBox;
i:integer;
begin
file1:=TFileListBox.Create(Owner);
file1.Parent :=Owner;
file1.Mask:=Mask;
file1.Visible :=false;
file1.Directory :=dir;
list.BeginUpdate;
list.Clear;
for i:=0 to file1.Items.Count-1 do
list.Add(file1.Items[i]);
list.EndUpdate;
file1.free;
end;

//将系统加入到托盘,像金山词霸那样。
procedure AddIcon(bAdd:boolean;selfHandle:THandle;msg:UINT;tip:string);
var FIconData: TNotifyIconData;
begin
with FIconData do
begin
cbSize := SizeOf(FIconData);
Wnd := selfHandle;
uID := $DEDB;
uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
hIcon := application.Icon.Handle;
uCallbackMessage := msg;
StrCopy(szTip, PChar(tip));
end;
if bAdd then
Shell_NotifyIcon(NIM_Add, @FIconData)
else
Shell_notifyIcon(NIM_Delete,@FiconData);
end;
//如果不想显示出窗体。
{
procedure TForm1.OnCreate(Sender as TObject);
begin
Application.ShowMainForm:=false;
AddIcon(true,self,WM_myCallbackMSG,'my hint');
ShowWindow(Handle,SW_HIDE);
end;
}  
 


--------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -