📄 wyabdc.dpr
字号:
program WYABDC;
uses
Forms,
Windows,
SysUtils,
Dialogs,
TopEdit in 'TopEdit.pas' {frmShow},
Option in 'Option.pas' {FrmOpt},
Settime in 'Settime.pas' {FrmTime},
about in 'about.pas' {Frmabout},
SelectBook in 'SelectBook.pas' {frmSelectBook},
ScrSave in 'ScrSave.pas' {frmSave},
Progress in 'Progress.pas' {frmProgress},
SetSpeech in 'SetSpeech.pas' {frmSetSpeech},
ACRODISTXLib_TLB in 'C:\Program Files\Borland\Delphi6\Imports\ACRODISTXLib_TLB.pas';
var
ExtendedStyle: Integer;
Param: string;
const iAtom = 'wyabdc.atom';
{$R *.res}
begin
Application.Initialize;
//隐藏任务栏
ExtendedStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);
SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle or
WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
Application.Title := '我也爱背单词';
//ParamCount返回的是参数个数,ParamStr[0]是你的可执行文件的路径,从1开始是你的程序的参数
if (Paramcount > 0) then
begin
Param := Copy(UpperCase(ParamStr(1)), 1, 2);
if Param = '/S' then //屏保
begin
Application.CreateForm(TfrmSave, frmSave);
Application.Run;
end;
if Param = '/C' then //设置
begin
Application.CreateForm(TFrmAbout, frmAbout);
Application.Run;
end;
if Param = '/P' then //预览
Application.Run;
end
else begin
{
我们也可以利用向系统添加全局原子的方法,来防止多个程序实例的运行。
全局原子由Windows 系统负责维持,它能保证其中的每个原子都是唯一的,
管理其引用计数,并且当该全局原子的引用计数为0时,从内存中清除。
我们用GlobalAddAtom 函数向全局原子添加一个255个字节以内的字符串,
用GlobalFindAtom来检查是否已经存在该全局原子,
最后在程序结束时用GlobalDeleteAtom函数删除添加的全局原子
}
GlobalDeleteAtom(GlobalFindAtom(iAtom));
if GlobalFindAtom(iAtom) = 0 then
begin
GlobalAddAtom(iAtom);
frmSplash := TfrmAbout.Create(application);
frmSplash.Show;
frmSplash.Update;
Application.CreateForm(TfrmShow, frmShow);
Application.CreateForm(TFrmOpt, FrmOpt);
Application.CreateForm(TFrmTime, FrmTime);
Application.CreateForm(TFrmabout, Frmabout);
Application.CreateForm(TfrmSelectBook, frmSelectBook);
Application.CreateForm(TfrmProgress, frmProgress);
Application.CreateForm(TfrmSetSpeech, frmSetSpeech);
Application.Run;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -