Commit 8975ce8a by 원종진

Revert "Revert "..""

This reverts commit 18f02537.
parent 18f02537
...@@ -44,6 +44,7 @@ begin ...@@ -44,6 +44,7 @@ begin
hMutex := CreateMutex(nil, True, C_MUTEX_NAME); hMutex := CreateMutex(nil, True, C_MUTEX_NAME);
Application.Initialize; Application.Initialize;
Application.ShowMainForm := false; Application.ShowMainForm := false;
Application.CreateForm(TfrmMain, frmMain); Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TfrmResult, frmResult); 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 ...@@ -11,6 +11,7 @@ object frmMain: TfrmMain
Font.Name = #44404#47548#52404 Font.Name = #44404#47548#52404
Font.Style = [] Font.Style = []
OldCreateOrder = False OldCreateOrder = False
OnActivate = FormActivate
OnClose = FormClose OnClose = FormClose
OnHide = FormHide OnHide = FormHide
OnShow = FormShow OnShow = FormShow
...@@ -34,6 +35,15 @@ object frmMain: TfrmMain ...@@ -34,6 +35,15 @@ object frmMain: TfrmMain
TabOrder = 1 TabOrder = 1
OnClick = Button2Click OnClick = Button2Click
end end
object Button3: TButton
Left = 24
Top = 152
Width = 97
Height = 57
Caption = 'Button3'
TabOrder = 2
OnClick = Button3Click
end
object ActionManager1: TActionManager object ActionManager1: TActionManager
Left = 400 Left = 400
Top = 72 Top = 72
......
...@@ -23,6 +23,7 @@ type ...@@ -23,6 +23,7 @@ type
N10: TMenuItem; N10: TMenuItem;
Button1: TButton; Button1: TButton;
Button2: TButton; Button2: TButton;
Button3: TButton;
procedure RxTrayIcon1DblClick(Sender: TObject); procedure RxTrayIcon1DblClick(Sender: TObject);
procedure actTerminateAppExecute(Sender: TObject); procedure actTerminateAppExecute(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
...@@ -32,8 +33,11 @@ type ...@@ -32,8 +33,11 @@ type
procedure actShowConfigFormExecute(Sender: TObject); procedure actShowConfigFormExecute(Sender: TObject);
procedure Button1Click(Sender: TObject); procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject); procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
protected protected
procedure ScannerBarcodeEvent(ASender: TObject; eventType: Smallint; var pscanData: WideString); procedure ScannerBarcodeEvent(ASender: TObject; eventType: Smallint; var pscanData: WideString);
procedure CreateParams(var Params: TCreateParams); override;
private private
{ Private declarations } { Private declarations }
private private
...@@ -70,7 +74,6 @@ var ...@@ -70,7 +74,6 @@ var
Icon : TIcon; Icon : TIcon;
begin begin
inherited; inherited;
// Scanner initialization // Scanner initialization
Open_Zebra; Open_Zebra;
Discover_Zebra; Discover_Zebra;
...@@ -202,11 +205,11 @@ begin ...@@ -202,11 +205,11 @@ begin
aEncodeStr := AES128EncodeString(HexStrToStr(aHexStr), aAESKey); aEncodeStr := AES128EncodeString(HexStrToStr(aHexStr), aAESKey);
RstStr := ReqDCInfo(aEncodeStr);
with frmResult do with frmResult do
begin begin
SetResult(RstStr);
Show; Show;
RstStr := ReqDCInfo(aEncodeStr);
SetResult(RstStr);
end; end;
end; end;
...@@ -214,11 +217,12 @@ procedure TfrmMain.Button1Click(Sender: TObject); ...@@ -214,11 +217,12 @@ procedure TfrmMain.Button1Click(Sender: TObject);
var var
RstStr : String; RstStr : String;
begin begin
RstStr := ReqDCInfo('aa');
with frmResult do with frmResult do
begin begin
SetResult(RstStr);
Show; Show;
RstStr := ReqDCInfo('aa');
SetResult(RstStr);
end; end;
end; end;
...@@ -226,12 +230,40 @@ procedure TfrmMain.Button2Click(Sender: TObject); ...@@ -226,12 +230,40 @@ procedure TfrmMain.Button2Click(Sender: TObject);
var var
RstStr : String; RstStr : String;
begin begin
RstStr := ReqDCInfo('VGuPMlIvv+qjao/YXKDe5A==');
with frmResult do with frmResult do
begin begin
Show;
RstStr := ReqDCInfo('VGuPMlIvv+qjao/YXKDe5A==');
SetResult(RstStr); SetResult(RstStr);
end;
end;
procedure TfrmMain.Button3Click(Sender: TObject);
var
aAESKey : String;
RstStr : String;
begin
aAESKey := g_FacilityID + 'scn2019x';
with frmResult do
begin
Show; Show;
RstStr := ReqDCInfo(AES128EncodeString('', aAESKey));
SetResult(RstStr);
end; end;
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. end.
object frmResult: TfrmResult object frmResult: TfrmResult
Left = 889 Left = 891
Top = 189 Top = 225
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'frmResult' ClientHeight = 644
ClientHeight = 247
ClientWidth = 348 ClientWidth = 348
Color = clBtnFace Color = clBtnFace
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
...@@ -14,18 +13,21 @@ object frmResult: TfrmResult ...@@ -14,18 +13,21 @@ object frmResult: TfrmResult
FormStyle = fsStayOnTop FormStyle = fsStayOnTop
KeyPreview = True KeyPreview = True
OldCreateOrder = False OldCreateOrder = False
Position = poDefault OnActivate = FormActivate
OnKeyPress = FormKeyPress OnKeyPress = FormKeyPress
OnResize = FormResize
OnShow = FormShow OnShow = FormShow
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 12 TextHeight = 12
object ListBox1: TListBox object ListBox1: TListBox
Left = 0 Left = 104
Top = 0 Top = 40
Width = 348 Width = 220
Height = 247 Height = 175
Style = lbOwnerDrawFixed Style = lbOwnerDrawFixed
Align = alClient BevelEdges = []
BevelInner = bvNone
BevelOuter = bvNone
BorderStyle = bsNone BorderStyle = bsNone
Ctl3D = False Ctl3D = False
ExtendedSelect = False ExtendedSelect = False
......
...@@ -12,7 +12,11 @@ type ...@@ -12,7 +12,11 @@ type
procedure FormKeyPress(Sender: TObject; var Key: Char); procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure ListBox1DrawItem(Control: TWinControl; Index: Integer; procedure ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState); Rect: TRect; State: TOwnerDrawState);
procedure FormResize(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure FormActivate(Sender: TObject);
protected
procedure CreateParams(var Params: TCreateParams); override;
private private
{ Private declarations } { Private declarations }
fResultList : TQueryResultList; fResultList : TQueryResultList;
...@@ -22,6 +26,7 @@ type ...@@ -22,6 +26,7 @@ type
destructor Destroy; override; destructor Destroy; override;
procedure SetResult(const aData : String); procedure SetResult(const aData : String);
procedure ClearData;
end; end;
var var
...@@ -44,6 +49,9 @@ var ...@@ -44,6 +49,9 @@ var
begin begin
inherited; inherited;
fResultList := TQueryResultList.Create; fResultList := TQueryResultList.Create;
Self.Color := clWhite;
icon := TIcon.Create; icon := TIcon.Create;
try try
Icon.Handle := LoadIcon(hInstance, 'ActiveIcon'); Icon.Handle := LoadIcon(hInstance, 'ActiveIcon');
...@@ -63,8 +71,7 @@ var ...@@ -63,8 +71,7 @@ var
pDetailItem : PRecResultDetail; pDetailItem : PRecResultDetail;
JSONArrIter : TSuperObjectIter; JSONArrIter : TSuperObjectIter;
begin begin
fResultList.Clear; ClearData;
ListBox1.Items.Clear;
SuperObj := SO(aData); SuperObj := SO(aData);
aAESKey := g_FacilityID + 'scn2019x'; aAESKey := g_FacilityID + 'scn2019x';
...@@ -109,7 +116,6 @@ begin ...@@ -109,7 +116,6 @@ begin
ObjectFindClose(JSONArrIter); ObjectFindClose(JSONArrIter);
end; end;
end; end;
Self.Caption := name; Self.Caption := name;
end; end;
end; end;
...@@ -131,6 +137,7 @@ procedure TfrmResult.ListBox1DrawItem(Control: TWinControl; Index: Integer; ...@@ -131,6 +137,7 @@ procedure TfrmResult.ListBox1DrawItem(Control: TWinControl; Index: Integer;
var var
KeyStr, ValueStr : String; KeyStr, ValueStr : String;
begin begin
inherited;
if Index < 0 then exit; if Index < 0 then exit;
if Index > fResultList.Count-1 then exit; if Index > fResultList.Count-1 then exit;
...@@ -138,7 +145,7 @@ begin ...@@ -138,7 +145,7 @@ begin
ValueStr := PRecResultDetail(fResultList.Items[Index])^.Value; ValueStr := PRecResultDetail(fResultList.Items[Index])^.Value;
with TListbox(Control).Canvas do with TListbox(Control).Canvas do
begin begin
if odSelected in State then if odSelected in State then
begin begin
Brush.Color := $00238AFF; Brush.Color := $00238AFF;
...@@ -152,18 +159,45 @@ begin ...@@ -152,18 +159,45 @@ begin
Rectangle(Rect); Rectangle(Rect);
Font.Style := [fsBold]; 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(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); DrawTextEx(Handle, PChar(ValueStr), Length(ValueStr), Rect, DT_VCENTER or DT_SINGLELINE or DT_RIGHT, nil);
end; end;
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); procedure TfrmResult.FormShow(Sender: TObject);
begin begin
Self.Height := 683;
Self.Left := Screen.Width - Self.Width; Self.Left := Screen.Width - Self.Width;
Self.Top := Screen.Height - Self.Height - 45; Self.Top := Screen.Height - Self.Height - 45;
end; 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. 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