📄 jediedit.dpr
字号:
Program JediEdit;
Uses
Forms,
Windows,
SysUtils,
RegFiles,
IniFiles,
AppUtils,
MainEdit,
EditModule,
GrepResultsDlg,
ReplacePromptDialog,
AboutDlg;
{$R *.RES}
Var
Previous: HWnd;
{This code, to allow file association and open doubleclicked file in the running
instance of app was written by Andrius Adamonis}
Function EnumWindowsCallback(Handle: HWnd; Param: LParam): Boolean; Stdcall;
Function IsMyClass: Boolean;
Var
ClassName: Array[0..30] Of Char;
Begin
GetClassName(Handle, ClassName, 30);
Result := (StrIComp(ClassName, 'TfrmJediEdit') = 0) And { this finds my window, TfrmJediEdit }
(SendMessage(Handle, WM_FINDINSTANCE, 0, 0) = MyUniqueConst); { this checks if this is really my application }
End;
Begin
Result := Not IsMyClass; { needs True to continue }
If Not Result { = MyClass } Then Previous := Handle;
End;
Var
Atom: TAtom;
// s: String;
Ini: TIniFile;
Begin
Previous := 0;
EnumWindows(@EnumWindowsCallback, 0);
If Previous <> 0 Then Begin
PostMessage(Previous, WM_RESTOREAPP, 0, 0);
If ParamCount > 0 Then Begin
Atom := GlobalAddAtom(PChar(ParamStr(1)));
SendMessage(Previous, WM_OPENEDITOR, Atom, 0);
GlobalDeleteAtom(Atom);
End;
Exit;
End;
Application.Initialize;
Ini := TIniFile.Create(ExtractFilePath(Application.ExeName) + GetDefaultIniName);
Try
If Ini.ReadBool(secEditor, 'ShowSplash', True) Then DlgAbout := TDlgAbout.Create(Nil);
Finally
Ini.Free;
End;
Try
If Assigned(DlgAbout) Then DlgAbout.ShowSplash;
If Assigned(DlgAbout) Then DlgAbout.Update;
//AssociationExists('*', s);
//If UpperCase(s) <> UpperCase(Application.ExeName) Then RegisterAllFileType('JediEdit', '"' + Application.ExeName + '" "%1"');
Application.CreateForm(TEditorDataModule, EditorDataModule);
If Assigned(DlgAbout) Then DlgAbout.Refresh;
Application.CreateForm(TfrmJediEdit, frmJediEdit);
Application.CreateForm(TdlgReplacePrompt, dlgReplacePrompt);
Application.CreateForm(TfrmGrepResults, frmGrepResults);
Finally
If Assigned(DlgAbout) Then DlgAbout.Free;
End;
Application.Run;
End.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -