Many new features! Have to be used.
This commit is contained in:
65
tim2view.dpr
Normal file
65
tim2view.dpr
Normal file
@@ -0,0 +1,65 @@
|
||||
program tim2view;
|
||||
|
||||
uses
|
||||
Windows,
|
||||
Vcl.Forms,
|
||||
Vcl.Themes,
|
||||
Vcl.Styles,
|
||||
ecc in 'units\ecc.pas',
|
||||
edc in 'units\edc.pas',
|
||||
uCDIMAGE in 'units\uCDIMAGE.pas',
|
||||
uCommon in 'Units\uCommon.pas',
|
||||
uMain in 'Units\uMain.pas' {frmMain},
|
||||
uScanThread in 'Units\uScanThread.pas',
|
||||
uTIM in 'units\uTIM.pas',
|
||||
uDrawTIM in 'units\uDrawTIM.pas',
|
||||
uEventWaitThread in 'units\uEventWaitThread.pas',
|
||||
uBrowseForFolder in 'units\uBrowseForFolder.pas';
|
||||
|
||||
{$R *.res}
|
||||
|
||||
const
|
||||
cMailslot = '\\.\mailslot\t2v_slot';
|
||||
cEventNname = 't2v_open_event';
|
||||
|
||||
var
|
||||
ClientMailSlot: THandle;
|
||||
path: string;
|
||||
BytesWritten: DWORD;
|
||||
|
||||
begin
|
||||
ServerMailSlot := CreateMailslot(cMailslot, 0, MAILSLOT_WAIT_FOREVER, nil);
|
||||
|
||||
if ServerMailSlot = INVALID_HANDLE_VALUE then
|
||||
begin
|
||||
if GetLastError = ERROR_ALREADY_EXISTS then
|
||||
begin
|
||||
ClientMailSlot := CreateFile(cMailslot, GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
|
||||
if ParamCount > 0 then
|
||||
path := ParamStr(1)
|
||||
else
|
||||
path := '';
|
||||
|
||||
WriteFile(ClientMailSlot, path[1], Length(path) * SizeOf(Char), BytesWritten, nil);
|
||||
|
||||
CommandEvent := OpenEvent(EVENT_MODIFY_STATE, False, cEventNname);
|
||||
SetEvent(CommandEvent);
|
||||
|
||||
CloseHandle(CommandEvent);
|
||||
CloseHandle(ClientMailSlot);
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
CommandEvent := CreateEvent(nil, False, False, cEventNname);
|
||||
|
||||
Application.Initialize;
|
||||
Application.MainFormOnTaskbar := True;
|
||||
Application.CreateForm(TfrmMainT2V, frmMain);
|
||||
Application.Run;
|
||||
|
||||
CloseHandle(ServerMailSlot);
|
||||
CloseHandle(CommandEvent);
|
||||
end;
|
||||
end.
|
||||
Reference in New Issue
Block a user