BSOne.SFC/Tocsg.Module/PrintMark/EXE_PrintMark/PrintMark.dpr

55 lines
1.2 KiB
Plaintext

program PrintMark;
uses
Vcl.Forms,
Tocsg.Win32,
Tocsg.Safe,
Tocsg.Param,
Tocsg.Process,
Tocsg.Path,
System.SysUtils,
Winapi.Windows,
DPtrMkMain in 'DPtrMkMain.pas' {DlgPtrMkMain},
GlobalDefine in '..\LIB_Common\GlobalDefine.pas';
{$R *.res}
var
mtx: TTgMutex;
param: TTgParam;
begin
ReportMemoryLeaksOnShutdown := DebugHook <> 0;
param := TTgParam.Create;
try
if param.ExistsParam('-ptrblockmsg') then
begin
MessageBox(0, '프린트가 차단되었습니다.', 'PrintMark', MB_ICONWARNING or MB_OK or MB_TOPMOST);
exit;
end else
if param.ExistsParam('-hook') then
begin
InjectModule(StrToIntDef(param.GetParamValue('-hook'), 0), GetRunExePathDir + DLL_APIHOOK);
exit;
end else
if param.ExistsParam('-clearhook') then
begin
EjectModuleFromPath(GetRunExePathDir + DLL_APIHOOK);
Sleep(1000);
EjectModuleFromPath(GetRunExePathDir + DLL_APIHOOK);
exit;
end;
finally
param.Free;
end;
Guard(mtx, TTgMutex.Create(APP_MUTEX {$IFNDEF WIN64} + '32' {$ENDIF}));
if mtx.MutexState <> msCreateOk then
exit;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TDlgPtrMkMain, DlgPtrMkMain);
Application.Run;
end.