BSOne.SFC/Tocsg.Module/LinkFileView/DLkFileViewMain.pas

67 lines
1.4 KiB
Plaintext

unit DLkFileViewMain;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TDlgLkFileViewMain = class(TForm)
Edit1: TEdit;
Button1: TButton;
mmInfo: TMemo;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DlgLkFileViewMain: TDlgLkFileViewMain;
implementation
uses
Tocsg.Shell, Tocsg.Files, Tocsg.Path, Tocsg.Strings;
{$R *.dfm}
procedure TDlgLkFileViewMain.Button1Click(Sender: TObject);
var
sResult: String;
begin
Edit1.Text := Trim(Edit1.Text);
if not FileExists(Edit1.Text) then
begin
MessageBox(Handle, PChar('존재하지 않는 파일입니다.'), PChar(Caption), MB_ICONWARNING or MB_OK);
exit;
end;
sResult := GetTargetExeFromLink(Edit1.Text);
mmInfo.Text := sResult;
// ShowMessage(sResult);
end;
procedure TDlgLkFileViewMain.Button2Click(Sender: TObject);
var
sChk: String;
n: Integer;
begin
sChk := CutFileExt(Edit1.Text);
if (sChk.Length > 0) and (sChk[sChk.Length] = ')') then
begin
n := LastIndexOf(' (', sChk);
if n > 0 then
Delete(sChk, n, sChk.Length - n + 1);
end;
mmInfo.Text := sChk;
end;
end.