Commit 2cd93421 by 원종진

..

parent de45aaad
......@@ -44,6 +44,7 @@ begin
hMutex := CreateMutex(nil, True, C_MUTEX_NAME);
Application.Initialize;
Application.ShowMainForm := false;
Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TfrmResult, frmResult);
......
; -- Example1.iss --
; Demonstrates copying 3 files and creating an icon.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
[Setup]
AppName="ESB Agent"
AppVersion=0.1
WizardStyle=modern
DefaultDirName="{autopf}\Hisco\ESB Agent"
DefaultGroupName="ESB Agent"
UninstallDisplayIcon={app}\esb_agent.exe
Compression=lzma2
SolidCompression=yes
OutputDir=.\Output
OutputBaseFilename=Setup
[Files]
Source: "..\bin\ESB_Agent.exe"; DestDir: "{app}"
Source: "..\bin\ESB_Agent.ini"; DestDir: "{app}"
Source: "..\bin\FMCUtils.dll"; DestDir: "{app}"
[Icons]
Name: "{group}\ESB Agent"; Filename: "{app}\Esb_Agent.exe";
Name: "{commonstartup}\ESB Agent"; Filename: "{app}\Esb_Agent.exe";
......@@ -11,6 +11,7 @@ object frmMain: TfrmMain
Font.Name = #44404#47548#52404
Font.Style = []
OldCreateOrder = False
OnActivate = FormActivate
OnClose = FormClose
OnHide = FormHide
OnShow = FormShow
......@@ -34,6 +35,15 @@ object frmMain: TfrmMain
TabOrder = 1
OnClick = Button2Click
end
object Button3: TButton
Left = 24
Top = 152
Width = 97
Height = 57
Caption = 'Button3'
TabOrder = 2
OnClick = Button3Click
end
object ActionManager1: TActionManager
Left = 400
Top = 72
......
......@@ -23,6 +23,7 @@ type
N10: TMenuItem;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure RxTrayIcon1DblClick(Sender: TObject);
procedure actTerminateAppExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
......@@ -32,8 +33,11 @@ type
procedure actShowConfigFormExecute(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
protected
procedure ScannerBarcodeEvent(ASender: TObject; eventType: Smallint; var pscanData: WideString);
procedure CreateParams(var Params: TCreateParams); override;
private
{ Private declarations }
private
......@@ -70,7 +74,6 @@ var
Icon : TIcon;
begin
inherited;
// Scanner initialization
Open_Zebra;
Discover_Zebra;
......@@ -202,11 +205,11 @@ begin
aEncodeStr := AES128EncodeString(HexStrToStr(aHexStr), aAESKey);
RstStr := ReqDCInfo(aEncodeStr);
with frmResult do
begin
SetResult(RstStr);
Show;
RstStr := ReqDCInfo(aEncodeStr);
SetResult(RstStr);
end;
end;
......@@ -214,11 +217,12 @@ procedure TfrmMain.Button1Click(Sender: TObject);
var
RstStr : String;
begin
RstStr := ReqDCInfo('aa');
with frmResult do
begin
SetResult(RstStr);
Show;
RstStr := ReqDCInfo('aa');
SetResult(RstStr);
end;
end;
......@@ -226,12 +230,40 @@ procedure TfrmMain.Button2Click(Sender: TObject);
var
RstStr : String;
begin
RstStr := ReqDCInfo('VGuPMlIvv+qjao/YXKDe5A==');
with frmResult do
begin
Show;
RstStr := ReqDCInfo('VGuPMlIvv+qjao/YXKDe5A==');
SetResult(RstStr);
end;
end;
procedure TfrmMain.Button3Click(Sender: TObject);
var
aAESKey : String;
RstStr : String;
begin
aAESKey := g_FacilityID + 'scn2019x';
with frmResult do
begin
Show;
RstStr := ReqDCInfo(AES128EncodeString('', aAESKey));
SetResult(RstStr);
end;
end;
procedure TfrmMain.FormActivate(Sender: TObject);
begin
SetWindowLong(Handle, GWL_EXSTYLE,
GetWindowLong(Handle, GWL_EXSTYLE) or
WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
ShowWindow(Application.Handle, SW_HIDE);
end;
procedure TfrmMain.CreateParams(var Params: TCreateParams);
begin
inherited;
end;
end.
object frmResult: TfrmResult
Left = 889
Top = 189
Left = 891
Top = 225
BorderStyle = bsDialog
Caption = 'frmResult'
ClientHeight = 247
ClientHeight = 644
ClientWidth = 348
Color = clBtnFace
Font.Charset = ANSI_CHARSET
......@@ -14,18 +13,21 @@ object frmResult: TfrmResult
FormStyle = fsStayOnTop
KeyPreview = True
OldCreateOrder = False
Position = poDefault
OnActivate = FormActivate
OnKeyPress = FormKeyPress
OnResize = FormResize
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
object ListBox1: TListBox
Left = 0
Top = 0
Width = 348
Height = 247
Left = 104
Top = 40
Width = 220
Height = 175
Style = lbOwnerDrawFixed
Align = alClient
BevelEdges = []
BevelInner = bvNone
BevelOuter = bvNone
BorderStyle = bsNone
Ctl3D = False
ExtendedSelect = False
......
......@@ -12,7 +12,11 @@ type
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
procedure FormResize(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormActivate(Sender: TObject);
protected
procedure CreateParams(var Params: TCreateParams); override;
private
{ Private declarations }
fResultList : TQueryResultList;
......@@ -22,6 +26,7 @@ type
destructor Destroy; override;
procedure SetResult(const aData : String);
procedure ClearData;
end;
var
......@@ -44,6 +49,9 @@ var
begin
inherited;
fResultList := TQueryResultList.Create;
Self.Color := clWhite;
icon := TIcon.Create;
try
Icon.Handle := LoadIcon(hInstance, 'ActiveIcon');
......@@ -63,8 +71,7 @@ var
pDetailItem : PRecResultDetail;
JSONArrIter : TSuperObjectIter;
begin
fResultList.Clear;
ListBox1.Items.Clear;
ClearData;
SuperObj := SO(aData);
aAESKey := g_FacilityID + 'scn2019x';
......@@ -109,7 +116,6 @@ begin
ObjectFindClose(JSONArrIter);
end;
end;
Self.Caption := name;
end;
end;
......@@ -131,6 +137,7 @@ procedure TfrmResult.ListBox1DrawItem(Control: TWinControl; Index: Integer;
var
KeyStr, ValueStr : String;
begin
inherited;
if Index < 0 then exit;
if Index > fResultList.Count-1 then exit;
......@@ -138,7 +145,7 @@ begin
ValueStr := PRecResultDetail(fResultList.Items[Index])^.Value;
with TListbox(Control).Canvas do
begin
begin
if odSelected in State then
begin
Brush.Color := $00238AFF;
......@@ -152,18 +159,45 @@ begin
Rectangle(Rect);
Font.Style := [fsBold];
Pen.Color := clBlack;
Pen.Width := 1;
DrawTextEx(Handle, PChar(KeyStr), Length(KeyStr), Rect, DT_VCENTER or DT_SINGLELINE or DT_LEFT, nil);
DrawTextEx(Handle, PChar(ValueStr), Length(ValueStr), Rect, DT_VCENTER or DT_SINGLELINE or DT_RIGHT, nil);
end;
end;
procedure TfrmResult.ClearData;
begin
fResultList.Clear;
ListBox1.Items.Clear;
end;
procedure TfrmResult.FormResize(Sender: TObject);
begin
ListBox1.Left := 5;
ListBox1.Width := Self.Width - 17;
ListBox1.Top := 5;
ListBox1.Height := Self.Height - 10;
end;
procedure TfrmResult.FormShow(Sender: TObject);
begin
Self.Height := 683;
Self.Left := Screen.Width - Self.Width;
Self.Top := Screen.Height - Self.Height - 45;
end;
procedure TfrmResult.FormActivate(Sender: TObject);
begin
SetWindowLong(Handle, GWL_EXSTYLE,
GetWindowLong(Handle, GWL_EXSTYLE) or
WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
ShowWindow(Application.Handle, SW_HIDE);
end;
procedure TfrmResult.CreateParams(var Params: TCreateParams);
begin
inherited;
end;
end.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment