📄 freeotfe.dpr
字号:
program FreeOTFE;
uses
Forms,
FreeOTFEfrmMain in 'FreeOTFEfrmMain.pas' {frmFreeOTFEMain},
About_U in 'About_U.pas' {About_F},
FreeOTFEConsts in 'FreeOTFEConsts.pas',
FreeOTFEfrmVolProperties in 'FreeOTFEfrmVolProperties.pas' {frmFreeOTFEVolProperties},
FreeOTFEfrmSelectOverwriteMethod in 'FreeOTFEfrmSelectOverwriteMethod.pas' {frmFreeOTFESelectOverwriteMethod},
FreeOTFEfrmCDBDump in 'FreeOTFEfrmCDBDump.pas' {frmFreeOTFECDBDump},
FreeOTFEfrmCDBBackupRestore in 'FreeOTFEfrmCDBBackupRestore.pas' {frmFreeOTFECDBBackupRestore},
FreeOTFESettings in 'FreeOTFESettings.pas',
FreeOTFEfrmOptions in 'FreeOTFEfrmOptions.pas' {frmOptions},
Windows, // Required for THandle
SDUGeneral;
{$R *.RES}
var
otherRunningAppWindow: THandle;
CommandLineOnly: boolean;
exitCode: integer;
begin
GLOBAL_VAR_WM_FREEOTFE_RESTORE := RegisterWindowMessage('FREEOTFE_RESTORE');
GLOBAL_VAR_WM_FREEOTFE_REFRESH := RegisterWindowMessage('FREEOTFE_REFRESH');
Application.Initialize;
Application.Title := 'FreeOTFE';
Application.ShowMainForm := FALSE;
// NOTE: The main form's Visible property is set to FALSE anyway - it *HAS*
// to be, otherwise it'll be displayed; dispite the following two lines
Application.CreateForm(TfrmFreeOTFEMain, frmFreeOTFEMain);
frmFreeOTFEMain.visible := FALSE;
Application.ShowMainForm := FALSE;
Settings:= TFreeOTFESettings.Create();
Settings.Load();
CommandLineOnly := frmFreeOTFEMain.HandleCommandLineOpts(exitCode);
// if we were called with no command line arguments then
// if no running app was found then
// we continue to run the main app
// else
// we raise the previous application to the top
// else
// quit (ran with command line arguments)
// if we were called with no command line arguments then
if (not(CommandLineOnly)) then
begin
otherRunningAppWindow := SDUDetectExistingApp();
// If no running app was found then
if (
(otherRunningAppWindow = 0) or
Settings.OptAllowMultipleInstances
) then
begin
// We continue to run the main app
frmFreeOTFEMain.visible := TRUE;
Application.ShowMainForm := TRUE;
frmFreeOTFEMain.InitApp();
Application.Run;
end
else
begin
// Poke already running application
SendMessage(
otherRunningAppWindow,
GLOBAL_VAR_WM_FREEOTFE_RESTORE,
0,
0
);
end;
end
else
begin
// Quit (ran with command line arguments)
// (i.e. do nothing)
Halt(exitCode);
end;
// Note: We *don't* free of the Settings object; the main form is still
// closing down at this stage, and this causes an exception.
// Settings.Free();
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -