You've already forked lazarus-ccr
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@601 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
BIN
components/onguard/docs/Help/Delphi/ONGUARD.GID
Normal file
BIN
components/onguard/docs/Help/Delphi/ONGUARD.GID
Normal file
Binary file not shown.
19
components/onguard/docs/Help/Delphi/onguard.cnt
Normal file
19
components/onguard/docs/Help/Delphi/onguard.cnt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
:Base ONGUARD.HLP
|
||||||
|
:Title Components
|
||||||
|
1 Overview
|
||||||
|
2 Contents=OnGuard_Contents
|
||||||
|
1 Classes
|
||||||
|
2 TOgCodeBase Class=TOgCodeBase_Class
|
||||||
|
1 Components
|
||||||
|
2 TOgDateCode Component=TOgDateCode_Component
|
||||||
|
2 TOgDaysCode Component=TOgDaysCode_Component
|
||||||
|
2 TOgMakeCodes Component=TOgMakeCodes_Component
|
||||||
|
2 TOgMakeKeys Component=TOgMakeKeys_Component
|
||||||
|
2 TOgNetCode Component=TOgNetCode_Component
|
||||||
|
2 TOgProtectExe Component=TOgProtectExe_Component
|
||||||
|
2 TOgRegistrationCode Component=TOgRegistrationCode_Component
|
||||||
|
2 TOgSerialNumberCode Component=TOgSerialNumberCode_Component
|
||||||
|
2 TOgSpecialCode Component=TOgSpecialCode_Component
|
||||||
|
2 TOgUsageCode Component=TOgUsageCode_Component
|
||||||
|
1 Low-Level Routines
|
||||||
|
2 API Reference=API_Reference
|
BIN
components/onguard/docs/Help/Delphi/onguard.hlp
Normal file
BIN
components/onguard/docs/Help/Delphi/onguard.hlp
Normal file
Binary file not shown.
BIN
components/onguard/docs/Help/Delphi/onguard.kwf
Normal file
BIN
components/onguard/docs/Help/Delphi/onguard.kwf
Normal file
Binary file not shown.
BIN
components/onguard/docs/Manual.pdf
Normal file
BIN
components/onguard/docs/Manual.pdf
Normal file
Binary file not shown.
2
components/onguard/examples/codegen/ONGUARD.INI
Normal file
2
components/onguard/examples/codegen/ONGUARD.INI
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Keys]
|
||||||
|
Flamenco=$E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4
|
211
components/onguard/examples/codegen/codegen.lpi
Normal file
211
components/onguard/examples/codegen/codegen.lpi
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Version Value="6"/>
|
||||||
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<AlwaysBuild Value="False"/>
|
||||||
|
</Flags>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value=".\"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="0"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="2">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Valid="True"/>
|
||||||
|
</Item2>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="14">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="codegen.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="73" Y="13"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="24"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="codegenu.pas"/>
|
||||||
|
<ComponentName Value="CodeGenFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ResourceFilename Value="codegenu.lrs"/>
|
||||||
|
<UnitName Value="CODEGENU"/>
|
||||||
|
<CursorPos X="38" Y="49"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="24"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<ComponentName Value="KeyMaintFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard3.lrs"/>
|
||||||
|
<UnitName Value="qonguard3"/>
|
||||||
|
<CursorPos X="17" Y="169"/>
|
||||||
|
<TopLine Value="164"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="..\..\source\ogconst.pas"/>
|
||||||
|
<UnitName Value="ogconst"/>
|
||||||
|
<CursorPos X="3" Y="62"/>
|
||||||
|
<TopLine Value="34"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="..\..\..\lazarus\lcl\include\control.inc"/>
|
||||||
|
<CursorPos X="1" Y="1544"/>
|
||||||
|
<TopLine Value="1525"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit4>
|
||||||
|
<Unit5>
|
||||||
|
<Filename Value="..\..\..\lazarus\lcl\interfaces\gtk\gtkwscontrols.pp"/>
|
||||||
|
<UnitName Value="GtkWSControls"/>
|
||||||
|
<CursorPos X="1" Y="270"/>
|
||||||
|
<TopLine Value="251"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit5>
|
||||||
|
<Unit6>
|
||||||
|
<Filename Value="..\..\..\lazarus\lcl\include\customlistbox.inc"/>
|
||||||
|
<CursorPos X="1" Y="401"/>
|
||||||
|
<TopLine Value="382"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit6>
|
||||||
|
<Unit7>
|
||||||
|
<Filename Value="\usr\share\fpcsrc\fcl\inc\inifiles.pp"/>
|
||||||
|
<UnitName Value="IniFiles"/>
|
||||||
|
<CursorPos X="3" Y="598"/>
|
||||||
|
<TopLine Value="593"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit7>
|
||||||
|
<Unit8>
|
||||||
|
<Filename Value="..\..\source\qonguard5.pas"/>
|
||||||
|
<UnitName Value="qonguard5"/>
|
||||||
|
<CursorPos X="1" Y="1"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
</Unit8>
|
||||||
|
<Unit9>
|
||||||
|
<Filename Value="..\..\source\qonguard2.pas"/>
|
||||||
|
<ComponentName Value="CodeGenerateFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard2.lrs"/>
|
||||||
|
<UnitName Value="qonguard2"/>
|
||||||
|
<CursorPos X="30" Y="209"/>
|
||||||
|
<TopLine Value="184"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit9>
|
||||||
|
<Unit10>
|
||||||
|
<Filename Value="..\..\source\onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="25" Y="57"/>
|
||||||
|
<TopLine Value="32"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit10>
|
||||||
|
<Unit11>
|
||||||
|
<Filename Value="..\..\source\qonguard1.pas"/>
|
||||||
|
<ComponentName Value="KeyGenerateFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard1.lrs"/>
|
||||||
|
<UnitName Value="qonguard1"/>
|
||||||
|
<CursorPos X="18" Y="9"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit11>
|
||||||
|
<Unit12>
|
||||||
|
<Filename Value="..\..\source\qonguard4.pas"/>
|
||||||
|
<ComponentName Value="EditProductFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard4.lrs"/>
|
||||||
|
<UnitName Value="qonguard4"/>
|
||||||
|
<CursorPos X="17" Y="36"/>
|
||||||
|
<TopLine Value="31"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit12>
|
||||||
|
<Unit13>
|
||||||
|
<Filename Value="..\..\source\ogutil.pas"/>
|
||||||
|
<UnitName Value="ogutil"/>
|
||||||
|
<CursorPos X="32" Y="693"/>
|
||||||
|
<TopLine Value="714"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit13>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<BreakPoints Count="3">
|
||||||
|
<Item1>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="159"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="212"/>
|
||||||
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="186"/>
|
||||||
|
</Item3>
|
||||||
|
</BreakPoints>
|
||||||
|
<Watches Count="1">
|
||||||
|
<Item1>
|
||||||
|
<Expression Value="KeyFileName"/>
|
||||||
|
<Enabled Value="False"/>
|
||||||
|
</Item1>
|
||||||
|
</Watches>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
19
components/onguard/examples/codegen/codegen.lpr
Normal file
19
components/onguard/examples/codegen/codegen.lpr
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
program CodeGen;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
{.$MODE Delphi}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
CODEGENU in 'CODEGENU.pas' {CodeGenFrm}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TCodeGenFrm, CodeGenFrm);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
89
components/onguard/examples/codegen/codegenu.lfm
Normal file
89
components/onguard/examples/codegen/codegenu.lfm
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
object CodeGenFrm: TCodeGenFrm
|
||||||
|
ActiveControl = GenerateBtn
|
||||||
|
Caption = 'Example Code Generator'
|
||||||
|
ClientHeight = 85
|
||||||
|
ClientWidth = 273
|
||||||
|
Font.Color = clText
|
||||||
|
Font.Height = 11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Font.Pitch = fpVariable
|
||||||
|
PixelsPerInch = 96
|
||||||
|
Position = poScreenCenter
|
||||||
|
ShowHint = True
|
||||||
|
TextHeight = 18
|
||||||
|
HorzScrollBar.Page = 272
|
||||||
|
HorzScrollBar.Range = 267
|
||||||
|
VertScrollBar.Page = 84
|
||||||
|
VertScrollBar.Range = 76
|
||||||
|
Left = 315
|
||||||
|
Height = 85
|
||||||
|
Top = 230
|
||||||
|
Width = 273
|
||||||
|
object CopySb: TSpeedButton
|
||||||
|
Color = clBtnFace
|
||||||
|
Glyph.Data = {
|
||||||
|
42010000424D4201000000000000760000002800000011000000110000000100
|
||||||
|
040000000000CC00000000000000000000000000000000000000000000000000
|
||||||
|
8000008000000080800080000000800080008080000080808000C0C0C0000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
|
||||||
|
8888800000008888888888888888800000008888888444444444800000008888
|
||||||
|
8884FFFFFFF48000000088888884F00000F48000000080000004FFFFFFF48000
|
||||||
|
000080FFFFF4F00000F48000000080F00004FFFFFFF48000000080FFFFF4F00F
|
||||||
|
44448000000080F00004FFFF4F488000000080FFFFF4FFFF44888000000080F0
|
||||||
|
0F04444448888000000080FFFF0F088888888000000080FFFF00888888888000
|
||||||
|
0000800000088888888880000000888888888888888880000000888888888888
|
||||||
|
888880000000
|
||||||
|
}
|
||||||
|
NumGlyphs = 0
|
||||||
|
OnClick = CopySbClick
|
||||||
|
Left = 244
|
||||||
|
Height = 22
|
||||||
|
Hint = 'Copy code to clipboard'
|
||||||
|
Top = 21
|
||||||
|
Width = 23
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Caption = 'Code'
|
||||||
|
Color = clNone
|
||||||
|
FocusControl = CodeEd
|
||||||
|
ParentColor = False
|
||||||
|
Left = 8
|
||||||
|
Height = 14
|
||||||
|
Top = 3
|
||||||
|
Width = 26
|
||||||
|
end
|
||||||
|
object GenerateBtn: TButton
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Generate Code'
|
||||||
|
OnClick = GenerateBtnClick
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 8
|
||||||
|
Height = 25
|
||||||
|
Hint = 'Display code generation dialog'
|
||||||
|
Top = 51
|
||||||
|
Width = 105
|
||||||
|
end
|
||||||
|
object CodeEd: TEdit
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 1
|
||||||
|
Left = 8
|
||||||
|
Height = 24
|
||||||
|
Top = 19
|
||||||
|
Width = 233
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 2
|
||||||
|
Left = 192
|
||||||
|
Height = 25
|
||||||
|
Top = 51
|
||||||
|
Width = 75
|
||||||
|
end
|
||||||
|
object OgMakeCodes1: TOgMakeCodes
|
||||||
|
KeyFileName = 'ONGUARD.INI'
|
||||||
|
ShowHints = True
|
||||||
|
left = 56
|
||||||
|
top = 152
|
||||||
|
end
|
||||||
|
end
|
37
components/onguard/examples/codegen/codegenu.lrs
Normal file
37
components/onguard/examples/codegen/codegenu.lrs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TCodeGenFrm','FORMDATA',[
|
||||||
|
'TPF0'#11'TCodeGenFrm'#10'CodeGenFrm'#13'ActiveControl'#7#11'GenerateBtn'#7'C'
|
||||||
|
+'aption'#6#22'Example Code Generator'#12'ClientHeight'#2'U'#11'ClientWidth'#3
|
||||||
|
+#17#1#10'Font.Color'#7#6'clText'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS S'
|
||||||
|
+'ans Serif'#10'Font.Pitch'#7#10'fpVariable'#13'PixelsPerInch'#2'`'#8'Positio'
|
||||||
|
+'n'#7#14'poScreenCenter'#8'ShowHint'#9#10'TextHeight'#2#18#18'HorzScrollBar.'
|
||||||
|
+'Page'#3#16#1#19'HorzScrollBar.Range'#3#11#1#18'VertScrollBar.Page'#2'T'#19
|
||||||
|
+'VertScrollBar.Range'#2'L'#4'Left'#3';'#1#6'Height'#2'U'#3'Top'#3#230#0#5'Wi'
|
||||||
|
+'dth'#3#17#1#0#12'TSpeedButton'#6'CopySb'#5'Color'#7#9'clBtnFace'#10'Glyph.D'
|
||||||
|
+'ata'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0#17#0#0#0#17#0
|
||||||
|
+#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
|
||||||
|
+#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0#128#128#128#0
|
||||||
|
+#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0#255#0#255#255
|
||||||
|
+#0#0#255#255#255#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136
|
||||||
|
+#136#136#136#136#128#0#0#0#136#136#136#132'DDDD'#128#0#0#0#136#136#136#132
|
||||||
|
+#255#255#255#244#128#0#0#0#136#136#136#132#240#0#0#244#128#0#0#0#128#0#0#4
|
||||||
|
+#255#255#255#244#128#0#0#0#128#255#255#244#240#0#0#244#128#0#0#0#128#240#0#4
|
||||||
|
+#255#255#255#244#128#0#0#0#128#255#255#244#240#15'DD'#128#0#0#0#128#240#0#4
|
||||||
|
+#255#255'OH'#128#0#0#0#128#255#255#244#255#255'D'#136#128#0#0#0#128#240#15#4
|
||||||
|
+'DDH'#136#128#0#0#0#128#255#255#15#8#136#136#136#128#0#0#0#128#255#255#0#136
|
||||||
|
+#136#136#136#128#0#0#0#128#0#0#8#136#136#136#136#128#0#0#0#136#136#136#136
|
||||||
|
+#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#9'NumGl'
|
||||||
|
+'yphs'#2#0#7'OnClick'#7#11'CopySbClick'#4'Left'#3#244#0#6'Height'#2#22#4'Hin'
|
||||||
|
+'t'#6#22'Copy code to clipboard'#3'Top'#2#21#5'Width'#2#23#0#0#6'TLabel'#6'L'
|
||||||
|
+'abel2'#7'Caption'#6#4'Code'#5'Color'#7#6'clNone'#12'FocusControl'#7#6'CodeE'
|
||||||
|
+'d'#11'ParentColor'#8#4'Left'#2#8#6'Height'#2#14#3'Top'#2#3#5'Width'#2#26#0#0
|
||||||
|
+#7'TButton'#11'GenerateBtn'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#13
|
||||||
|
+'Generate Code'#7'OnClick'#7#16'GenerateBtnClick'#8'TabOrder'#2#0#4'Left'#2#8
|
||||||
|
+#6'Height'#2#25#4'Hint'#6#30'Display code generation dialog'#3'Top'#2'3'#5'W'
|
||||||
|
+'idth'#2'i'#0#0#5'TEdit'#6'CodeEd'#8'ReadOnly'#9#8'TabOrder'#2#1#4'Left'#2#8
|
||||||
|
+#6'Height'#2#24#3'Top'#2#19#5'Width'#3#233#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Ki'
|
||||||
|
+'nd'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#4'Left'#3#192#0#6'Height'
|
||||||
|
+#2#25#3'Top'#2'3'#5'Width'#2'K'#0#0#12'TOgMakeCodes'#12'OgMakeCodes1'#11'Key'
|
||||||
|
+'FileName'#6#11'ONGUARD.INI'#9'ShowHints'#9#4'left'#2'8'#3'top'#3#152#0#0#0#0
|
||||||
|
]);
|
67
components/onguard/examples/codegen/codegenu.pas
Normal file
67
components/onguard/examples/codegen/codegenu.pas
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
unit CODEGENU;
|
||||||
|
|
||||||
|
{$MODE Delphi}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
LCLIntf,
|
||||||
|
SysUtils, Classes, Forms, Dialogs,
|
||||||
|
Buttons,LResources,StdCtrls, onguard,ogutil;
|
||||||
|
|
||||||
|
type
|
||||||
|
TCodeGenFrm = class(TForm)
|
||||||
|
GenerateBtn: TButton;
|
||||||
|
CodeEd: TEdit;
|
||||||
|
Label2: TLabel;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
CopySb: TSpeedButton;
|
||||||
|
OgMakeCodes1: TOgMakeCodes;
|
||||||
|
procedure CopySbClick(Sender: TObject);
|
||||||
|
procedure GenerateBtnClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
CodeGenFrm: TCodeGenFrm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
procedure TCodeGenFrm.CopySbClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
OldSelStart : Integer;
|
||||||
|
begin
|
||||||
|
OldSelStart := CodeEd.SelStart;
|
||||||
|
CodeEd.SelStart := 0;
|
||||||
|
CodeEd.SelLength := MaxInt;
|
||||||
|
CodeEd.CopyToClipboard;
|
||||||
|
CodeEd.SelStart := OldSelStart;
|
||||||
|
CodeEd.SelLength := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCodeGenFrm.GenerateBtnClick(Sender: TObject);
|
||||||
|
const
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
var
|
||||||
|
Work : TCode;
|
||||||
|
begin
|
||||||
|
{set default key to use}
|
||||||
|
OgMakeCodes1.SetKey(CKey);
|
||||||
|
if OgMakeCodes1.Execute then begin
|
||||||
|
{get the code}
|
||||||
|
OgMakeCodes1.GetCode(Work);
|
||||||
|
{display the code}
|
||||||
|
CodeEd.Text := OgUtil.BufferToHex(Work, SizeOf(Work));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i CODEGENU.lrs}
|
||||||
|
|
||||||
|
end.
|
156
components/onguard/examples/exdmod/exdmod.lpi
Normal file
156
components/onguard/examples/exdmod/exdmod.lpi
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Version Value="6"/>
|
||||||
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<AlwaysBuild Value="False"/>
|
||||||
|
</Flags>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value=".\"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="2"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="9">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exdmod.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="53" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="25"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exdmodu1.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exdmodu2.lrs"/>
|
||||||
|
<UnitName Value="Exdmodu1"/>
|
||||||
|
<CursorPos X="1" Y="84"/>
|
||||||
|
<TopLine Value="82"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="exdmodu2.pas"/>
|
||||||
|
<ComponentName Value="SNEntryDlg"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exdmodu2.lrs"/>
|
||||||
|
<UnitName Value="Exdmodu2"/>
|
||||||
|
<CursorPos X="26" Y="10"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="..\..\source\onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="1" Y="1369"/>
|
||||||
|
<TopLine Value="1355"/>
|
||||||
|
<EditorIndex Value="3"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="..\..\source\ogutil.pas"/>
|
||||||
|
<UnitName Value="ogutil"/>
|
||||||
|
<CursorPos X="1" Y="875"/>
|
||||||
|
<TopLine Value="858"/>
|
||||||
|
<EditorIndex Value="4"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit4>
|
||||||
|
<Unit5>
|
||||||
|
<Filename Value="..\..\source\onguard.inc"/>
|
||||||
|
<CursorPos X="51" Y="35"/>
|
||||||
|
<TopLine Value="6"/>
|
||||||
|
<EditorIndex Value="5"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit5>
|
||||||
|
<Unit6>
|
||||||
|
<Filename Value="usr\share\fpcsrc\rtl\inc\systemh.inc"/>
|
||||||
|
<CursorPos X="3" Y="350"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit6>
|
||||||
|
<Unit7>
|
||||||
|
<Filename Value="usr\share\fpcsrc\rtl\inc\system.inc"/>
|
||||||
|
<CursorPos X="14" Y="511"/>
|
||||||
|
<TopLine Value="500"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit7>
|
||||||
|
<Unit8>
|
||||||
|
<Filename Value="..\..\..\lazarus\lcl\interfaces\gtk\gtklclintf.inc"/>
|
||||||
|
<CursorPos X="1" Y="365"/>
|
||||||
|
<TopLine Value="346"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit8>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseLineInfoUnit Value="False"/>
|
||||||
|
<StripSymbols Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<BreakPoints Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Source Value="exdmodu1.pas"/>
|
||||||
|
<Line Value="220"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Source Value="exdmodu1.pas"/>
|
||||||
|
<Line Value="84"/>
|
||||||
|
</Item2>
|
||||||
|
</BreakPoints>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
14
components/onguard/examples/exdmod/exdmod.lpr
Normal file
14
components/onguard/examples/exdmod/exdmod.lpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program Exdmod;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
Exdmodu1 in 'EXDMODU1.PAS' {Form1},
|
||||||
|
Exdmodu2 in 'EXDMODU2.PAS' {SNEntryDlg}, tponguard;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
58
components/onguard/examples/exdmod/exdmodu1.lfm
Normal file
58
components/onguard/examples/exdmod/exdmodu1.lfm
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
ActiveControl = Memo1
|
||||||
|
Caption = 'Serial Number Example'
|
||||||
|
ClientHeight = 186
|
||||||
|
ClientWidth = 240
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
OnActivate = FormActivate
|
||||||
|
PixelsPerInch = 83
|
||||||
|
Position = poScreenCenter
|
||||||
|
TextHeight = 13
|
||||||
|
HorzScrollBar.Page = 239
|
||||||
|
VertScrollBar.Page = 185
|
||||||
|
Left = 372
|
||||||
|
Height = 186
|
||||||
|
Top = 223
|
||||||
|
Width = 240
|
||||||
|
object Label1: TLabel
|
||||||
|
Alignment = taCenter
|
||||||
|
Caption = 'Serial #: '
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
Left = 38
|
||||||
|
Height = 13
|
||||||
|
Top = 96
|
||||||
|
Width = 51
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Lines.Strings = (
|
||||||
|
'If you can edit this, then your program was '
|
||||||
|
'allowed to run'
|
||||||
|
)
|
||||||
|
ScrollBars = ssVertical
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 3
|
||||||
|
Height = 79
|
||||||
|
Top = 4
|
||||||
|
Width = 223
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 1
|
||||||
|
Left = 72
|
||||||
|
Height = 33
|
||||||
|
Top = 114
|
||||||
|
Width = 89
|
||||||
|
end
|
||||||
|
object OgSerialNumberCode1: TOgSerialNumberCode
|
||||||
|
OnChecked = OgSerialNumberCode1Checked
|
||||||
|
OnGetKey = OgSerialNumberCode1GetKey
|
||||||
|
OnGetCode = OgSerialNumberCode1GetCode
|
||||||
|
OnGetModifier = OgSerialNumberCode1GetModifier
|
||||||
|
left = 172
|
||||||
|
top = 88
|
||||||
|
end
|
||||||
|
end
|
21
components/onguard/examples/exdmod/exdmodu1.lrs
Normal file
21
components/onguard/examples/exdmod/exdmodu1.lrs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#21'Serial'
|
||||||
|
+' Number Example'#12'ClientHeight'#3#186#0#11'ClientWidth'#3#240#0#10'Font.C'
|
||||||
|
+'olor'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#13
|
||||||
|
+'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#10'TextHeight'#2#13#18
|
||||||
|
+'HorzScrollBar.Page'#3#239#0#18'VertScrollBar.Page'#3#185#0#4'Left'#3't'#1#6
|
||||||
|
+'Height'#3#186#0#3'Top'#3#223#0#5'Width'#3#240#0#0#6'TLabel'#6'Label1'#9'Ali'
|
||||||
|
+'gnment'#7#8'taCenter'#7'Caption'#6#10'Serial #: '#5'Color'#7#6'clNone'#11'P'
|
||||||
|
+'arentColor'#8#4'Left'#2'&'#6'Height'#2#14#3'Top'#2'`'#5'Width'#2'-'#0#0#5'T'
|
||||||
|
+'Memo'#5'Memo1'#13'Lines.Strings'#1#6',If you can edit this, then your progr'
|
||||||
|
+'am was '#6#14'allowed to run'#0#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'
|
||||||
|
+#2#0#4'Left'#2#3#6'Height'#2'O'#3'Top'#2#4#5'Width'#3#223#0#0#0#7'TBitBtn'#8
|
||||||
|
+'CloseBtn'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#4'Left'#2'H'
|
||||||
|
+#6'Height'#2'!'#3'Top'#2'r'#5'Width'#2'Y'#0#0#19'TOgSerialNumberCode'#19'OgS'
|
||||||
|
+'erialNumberCode1'#9'OnChecked'#7#26'OgSerialNumberCode1Checked'#8'OnGetKey'
|
||||||
|
+#7#25'OgSerialNumberCode1GetKey'#9'OnGetCode'#7#26'OgSerialNumberCode1GetCod'
|
||||||
|
+'e'#13'OnGetModifier'#7#30'OgSerialNumberCode1GetModifier'#4'left'#3#172#0#3
|
||||||
|
+'top'#2'X'#0#0#0
|
||||||
|
]);
|
250
components/onguard/examples/exdmod/exdmodu1.pas
Normal file
250
components/onguard/examples/exdmod/exdmodu1.pas
Normal file
@ -0,0 +1,250 @@
|
|||||||
|
(*
|
||||||
|
This example shows how to generate a machine modifier at run time
|
||||||
|
while using the TOgSerialNumber component. This means the program
|
||||||
|
will run only on the machine being used to run the application.
|
||||||
|
|
||||||
|
If the program is being run the first time (as determined by the
|
||||||
|
existance of an INI file, a dialog box is displayed showing the
|
||||||
|
modifier value along with two entry fields: one for the serial
|
||||||
|
number, the other for the release code. The user enters the
|
||||||
|
values that you give him for these two items. The values are
|
||||||
|
stored in the INI file and the program is allowed to run.
|
||||||
|
|
||||||
|
The release code you give the user can be generated by the CODEGEN
|
||||||
|
example program. Be sure to select the same type component, the
|
||||||
|
key used to compile the application (the one returned in the
|
||||||
|
OnGetKey event), and enter the machine modifier the user gives
|
||||||
|
you - not the one automatically generated when you click the
|
||||||
|
MachineModifier radio button. Also, if used, make sure the
|
||||||
|
Expires date is the same.
|
||||||
|
*)
|
||||||
|
|
||||||
|
|
||||||
|
unit Exdmodu1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils,Classes,Controls,
|
||||||
|
Forms, Dialogs, StdCtrls, Buttons,LResources,
|
||||||
|
OgUtil,OnGuard,IniFiles;
|
||||||
|
|
||||||
|
const
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
|
||||||
|
$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
Label1: TLabel;
|
||||||
|
OgSerialNumberCode1: TOgSerialNumberCode;
|
||||||
|
procedure FormActivate(Sender: TObject);
|
||||||
|
procedure OgSerialNumberCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure OgSerialNumberCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure OgSerialNumberCode1Checked(Sender: TObject;
|
||||||
|
Status: TCodeStatus);
|
||||||
|
procedure OgSerialNumberCode1GetModifier(Sender: TObject;
|
||||||
|
var Value: Longint);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
FExpired : Boolean;
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
TheDir : string;
|
||||||
|
IniSNVal : longint;
|
||||||
|
IniFile : TIniFile;
|
||||||
|
|
||||||
|
function GetSNData(var S : string) : integer;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
uses
|
||||||
|
Exdmodu2;
|
||||||
|
|
||||||
|
{=======================================================================}
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.OgSerialNumberCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
begin
|
||||||
|
Key := CKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormActivate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FExpired then Application.Terminate;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{=======================================================================}
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.OgSerialNumberCode1GetModifier(Sender: TObject;
|
||||||
|
var Value: Longint);
|
||||||
|
begin
|
||||||
|
{Generate the value unique to this machine}
|
||||||
|
Value := GenerateMachineModifierPrim;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{=======================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgSerialNumberCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
var
|
||||||
|
S1 : string;
|
||||||
|
L : integer;
|
||||||
|
begin
|
||||||
|
{force the INI file to be in the same directory as the application}
|
||||||
|
TheDir := ExtractFilePath(ParamStr(0));
|
||||||
|
{
|
||||||
|
L := Length(TheDir);
|
||||||
|
if (L > 3) and (TheDir[L] <> '\') then
|
||||||
|
TheDir := TheDir + '\';
|
||||||
|
}
|
||||||
|
|
||||||
|
(*
|
||||||
|
this check helps prevent an empty INI file. For the combination of
|
||||||
|
this component and using the MachineModifier, an empty or
|
||||||
|
incomplete INI file can cause problems, i.e., if something goes wrong
|
||||||
|
during the initial input of the SN and ReleaseCode, the program could
|
||||||
|
not be run again without deleting the INI file. In a "real world"
|
||||||
|
application, you would probably be hiding these values some how and
|
||||||
|
would either have to tell the user where to delete things or have a
|
||||||
|
utility program to do so.
|
||||||
|
*)
|
||||||
|
if not (FileExists(TheDir + 'snwmod.ini')) then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
{open Ini File}
|
||||||
|
IniFile := TIniFile.Create(TheDir + 'snwmod.ini');
|
||||||
|
try
|
||||||
|
{try to read release code}
|
||||||
|
S1 := IniFile.ReadString('Codes', 'SNCode', '');
|
||||||
|
|
||||||
|
(*
|
||||||
|
set a global variable to the value of the serial number.
|
||||||
|
Since, by design, the TOgSerialNumber component does not
|
||||||
|
confirm that the SN and ReleaseCode retrieved from the INI
|
||||||
|
file are compatible, this value will be used later to
|
||||||
|
see if the user has attempted to change the contents of
|
||||||
|
the INI file
|
||||||
|
*)
|
||||||
|
IniSNVal := IniFile.ReadInteger('Codes', 'SN', 0);
|
||||||
|
|
||||||
|
{convert retrieved string to a code}
|
||||||
|
HexToBuffer(S1, Code, SizeOf(Code));
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{=======================================================================}
|
||||||
|
|
||||||
|
function TForm1.GetSNData(var S : string) : integer;
|
||||||
|
{method used to ask for user input of serial number and release code}
|
||||||
|
var
|
||||||
|
TC : TCode;
|
||||||
|
SNC : string;
|
||||||
|
L : longint;
|
||||||
|
Key : TKey;
|
||||||
|
begin
|
||||||
|
Application.CreateForm(TSNEntryDlg, SNEntryDlg);
|
||||||
|
try
|
||||||
|
{Display new SN and ask for release code}
|
||||||
|
SNEntryDlg.SNText.Text := '';
|
||||||
|
SNEntryDlg.CodeText.Text := '';
|
||||||
|
|
||||||
|
Result := SNEntryDlg.ShowModal;
|
||||||
|
if (SNEntryDlg.CodeText.Text = '') or
|
||||||
|
(SNEntryDlg.SNText.Text = '') then
|
||||||
|
Result := mrCancel;
|
||||||
|
if (Result = mrCancel) then begin
|
||||||
|
S := 'Invalid Code or Cancelled';
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{Check that Release Code was entered correctly}
|
||||||
|
Key := CKey;
|
||||||
|
OgSerialNumberCode1.Modifier := SNEntryDlg.ModString.Text;
|
||||||
|
|
||||||
|
HexToBuffer(SNEntryDlg.ModString.Text, L, SizeOf(L));
|
||||||
|
|
||||||
|
HexToBuffer(SNEntryDlg.CodeText.Text, TC, SizeOf(TCode));
|
||||||
|
ApplyModifierToKeyPrim(L, Key, SizeOf(TKey));
|
||||||
|
|
||||||
|
if not (IsSerialNumberCodeValid(Key, TC)) then begin
|
||||||
|
S := 'Release code not entered correctly';
|
||||||
|
Result := mrCancel;
|
||||||
|
end else begin
|
||||||
|
IniFile := TIniFile.Create(TheDir + 'snwmod.ini');
|
||||||
|
try
|
||||||
|
{write SN to IniFile}
|
||||||
|
IniSNVal := StrToInt(SNEntryDlg.SNText.Text);
|
||||||
|
SNC := SNEntryDlg.CodeText.Text;
|
||||||
|
IniFile.WriteInteger('Codes', 'SN', IniSNVal);
|
||||||
|
IniFile.WriteString('Codes', 'SNCode', SNC);
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
SNEntryDlg.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{=======================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgSerialNumberCode1Checked(Sender: TObject;
|
||||||
|
Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
LI : longint;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
FExpired := false;
|
||||||
|
case Status of
|
||||||
|
ogValidCode : begin
|
||||||
|
{check if retrieved Serial Number matches Code}
|
||||||
|
LI := OgSerialNumberCode1.GetValue;
|
||||||
|
|
||||||
|
if (LI <> IniSNVal) then begin
|
||||||
|
S := 'The serial number has been changed';
|
||||||
|
end else begin
|
||||||
|
Label1.Caption := 'Serial #: ' + IntToStr(IniSNVal);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ogInvalidCode : begin
|
||||||
|
{if INI file doesn't exist, presume this is first run}
|
||||||
|
if not (FileExists(TheDir + 'snwmod.ini')) then begin
|
||||||
|
if not (GetSNData(S) = mrCancel) then begin
|
||||||
|
{Check the SN/ReleaseCode}
|
||||||
|
OgSerialNumberCode1.CheckCode(True);
|
||||||
|
{must Exit since line above began a recursive call}
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
S := 'Invalid Code';
|
||||||
|
end;
|
||||||
|
|
||||||
|
ogCodeExpired : S := 'Evaluation period expired';
|
||||||
|
end;
|
||||||
|
|
||||||
|
ShowMessage(S);
|
||||||
|
FExpired := true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exdmodu2.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
97
components/onguard/examples/exdmod/exdmodu2.lfm
Normal file
97
components/onguard/examples/exdmod/exdmodu2.lfm
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
object SNEntryDlg: TSNEntryDlg
|
||||||
|
ActiveControl = SNText
|
||||||
|
Caption = 'Serial Number w/Modifer'
|
||||||
|
ClientHeight = 195
|
||||||
|
ClientWidth = 247
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
OnCreate = FormCreate
|
||||||
|
PixelsPerInch = 83
|
||||||
|
Position = poScreenCenter
|
||||||
|
TextHeight = 13
|
||||||
|
HorzScrollBar.Page = 246
|
||||||
|
VertScrollBar.Page = 194
|
||||||
|
Left = 406
|
||||||
|
Height = 195
|
||||||
|
Top = 376
|
||||||
|
Width = 247
|
||||||
|
object Label1: TLabel
|
||||||
|
Caption = 'SN'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
Left = 8
|
||||||
|
Height = 13
|
||||||
|
Top = 64
|
||||||
|
Width = 18
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Caption = 'Code'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
Left = 8
|
||||||
|
Height = 13
|
||||||
|
Top = 90
|
||||||
|
Width = 31
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Caption = 'Call your Vendor NOW to register!'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
Left = 40
|
||||||
|
Height = 13
|
||||||
|
Top = 7
|
||||||
|
Width = 193
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Caption = 'Modifier'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
Left = 8
|
||||||
|
Height = 13
|
||||||
|
Top = 37
|
||||||
|
Width = 46
|
||||||
|
end
|
||||||
|
object SNText: TEdit
|
||||||
|
TabOrder = 1
|
||||||
|
Left = 52
|
||||||
|
Height = 20
|
||||||
|
Top = 60
|
||||||
|
Width = 121
|
||||||
|
end
|
||||||
|
object CodeText: TEdit
|
||||||
|
TabOrder = 2
|
||||||
|
Left = 52
|
||||||
|
Height = 20
|
||||||
|
Top = 86
|
||||||
|
Width = 175
|
||||||
|
end
|
||||||
|
object OKBtn: TBitBtn
|
||||||
|
Kind = bkOK
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 3
|
||||||
|
Left = 23
|
||||||
|
Height = 33
|
||||||
|
Top = 118
|
||||||
|
Width = 89
|
||||||
|
end
|
||||||
|
object CancelBtn: TBitBtn
|
||||||
|
Kind = bkCancel
|
||||||
|
NumGlyphs = 0
|
||||||
|
OnClick = CancelBtnClick
|
||||||
|
TabOrder = 4
|
||||||
|
Left = 127
|
||||||
|
Height = 33
|
||||||
|
Top = 118
|
||||||
|
Width = 89
|
||||||
|
end
|
||||||
|
object ModString: TEdit
|
||||||
|
ReadOnly = True
|
||||||
|
TabStop = False
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 52
|
||||||
|
Height = 20
|
||||||
|
Top = 33
|
||||||
|
Width = 121
|
||||||
|
end
|
||||||
|
end
|
46
components/onguard/examples/exdmod/exdmodu2.lrs
Normal file
46
components/onguard/examples/exdmod/exdmodu2.lrs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TSNEntryDlg','FORMDATA',[
|
||||||
|
'TPF0'#11'TSNEntryDlg'#10'SNEntryDlg'#13'ActiveControl'#7#6'SNText'#7'Caption'
|
||||||
|
+#6#23'Serial Number w/Modifer'#12'ClientHeight'#3#195#0#11'ClientWidth'#3#247
|
||||||
|
+#0#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sa'
|
||||||
|
+'ns Serif'#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2'S'#8'Position'#7
|
||||||
|
+#14'poScreenCenter'#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3#246#0#18'Ve'
|
||||||
|
+'rtScrollBar.Page'#3#194#0#4'Left'#3#150#1#6'Height'#3#195#0#3'Top'#3'x'#1#5
|
||||||
|
+'Width'#3#247#0#0#6'TLabel'#6'Label1'#7'Caption'#6#2'SN'#5'Color'#7#6'clNone'
|
||||||
|
+#11'ParentColor'#8#4'Left'#2#8#6'Height'#2#13#3'Top'#2'@'#5'Width'#2#18#0#0#6
|
||||||
|
+'TLabel'#6'Label2'#7'Caption'#6#4'Code'#5'Color'#7#6'clNone'#11'ParentColor'
|
||||||
|
+#8#4'Left'#2#8#6'Height'#2#13#3'Top'#2'Z'#5'Width'#2#31#0#0#6'TLabel'#6'Labe'
|
||||||
|
+'l3'#7'Caption'#6'!Call your Vendor NOW to register!'#5'Color'#7#6'clNone'#11
|
||||||
|
+'ParentColor'#8#4'Left'#2'('#6'Height'#2#13#3'Top'#2#7#5'Width'#3#193#0#0#0#6
|
||||||
|
+'TLabel'#6'Label4'#7'Caption'#6#8'Modifier'#5'Color'#7#6'clNone'#11'ParentCo'
|
||||||
|
+'lor'#8#4'Left'#2#8#6'Height'#2#13#3'Top'#2'%'#5'Width'#2'.'#0#0#5'TEdit'#6
|
||||||
|
+'SNText'#8'TabOrder'#2#1#4'Left'#2'4'#6'Height'#2#20#3'Top'#2'<'#5'Width'#2
|
||||||
|
+'y'#0#0#5'TEdit'#8'CodeText'#8'TabOrder'#2#2#4'Left'#2'4'#6'Height'#2#20#3'T'
|
||||||
|
+'op'#2'V'#5'Width'#3#175#0#0#0#7'TBitBtn'#5'OKBtn'#4'Kind'#7#4'bkOK'#9'NumGl'
|
||||||
|
+'yphs'#2#0#8'TabOrder'#2#3#4'Left'#2#23#6'Height'#2'!'#3'Top'#2'v'#5'Width'#2
|
||||||
|
+'Y'#0#0#7'TBitBtn'#9'CancelBtn'#4'Kind'#7#8'bkCancel'#9'NumGlyphs'#2#0#7'OnC'
|
||||||
|
+'lick'#7#14'CancelBtnClick'#8'TabOrder'#2#4#4'Left'#2''#6'Height'#2'!'#3'To'
|
||||||
|
+'p'#2'v'#5'Width'#2'Y'#0#0#5'TEdit'#9'ModString'#8'ReadOnly'#9#7'TabStop'#8#8
|
||||||
|
+'TabOrder'#2#0#4'Left'#2'4'#6'Height'#2#20#3'Top'#2'!'#5'Width'#2'y'#0#0#0
|
||||||
|
]);
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#21'Serial'
|
||||||
|
+' Number Example'#12'ClientHeight'#3#186#0#11'ClientWidth'#3#240#0#10'Font.C'
|
||||||
|
+'olor'#7#7'clBlack'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#10
|
||||||
|
+'OnActivate'#7#12'FormActivate'#13'PixelsPerInch'#2'S'#8'Position'#7#14'poSc'
|
||||||
|
+'reenCenter'#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3#239#0#18'VertScrol'
|
||||||
|
+'lBar.Page'#3#185#0#4'Left'#3't'#1#6'Height'#3#186#0#3'Top'#3#223#0#5'Width'
|
||||||
|
+#3#240#0#0#6'TLabel'#6'Label1'#9'Alignment'#7#8'taCenter'#7'Caption'#6#10'Se'
|
||||||
|
+'rial #: '#5'Color'#7#6'clNone'#11'ParentColor'#8#4'Left'#2'&'#6'Height'#2#13
|
||||||
|
+#3'Top'#2'`'#5'Width'#2'3'#0#0#5'TMemo'#5'Memo1'#13'Lines.Strings'#1#6',If y'
|
||||||
|
+'ou can edit this, then your program was '#6#14'allowed to run'#0#10'ScrollB'
|
||||||
|
+'ars'#7#10'ssVertical'#8'TabOrder'#2#0#4'Left'#2#3#6'Height'#2'O'#3'Top'#2#4
|
||||||
|
+#5'Width'#3#223#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Kind'#7#7'bkClose'#9'NumGlyph'
|
||||||
|
+'s'#2#0#8'TabOrder'#2#1#4'Left'#2'H'#6'Height'#2'!'#3'Top'#2'r'#5'Width'#2'Y'
|
||||||
|
+#0#0#19'TOgSerialNumberCode'#19'OgSerialNumberCode1'#9'OnChecked'#7#26'OgSer'
|
||||||
|
+'ialNumberCode1Checked'#8'OnGetKey'#7#25'OgSerialNumberCode1GetKey'#9'OnGetC'
|
||||||
|
+'ode'#7#26'OgSerialNumberCode1GetCode'#13'OnGetModifier'#7#30'OgSerialNumber'
|
||||||
|
+'Code1GetModifier'#4'left'#3#172#0#3'top'#2'X'#0#0#0
|
||||||
|
]);
|
57
components/onguard/examples/exdmod/exdmodu2.pas
Normal file
57
components/onguard/examples/exdmod/exdmodu2.pas
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
unit Exdmodu2;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils,Classes,Controls,
|
||||||
|
Forms, Dialogs, StdCtrls, Buttons,LResources;
|
||||||
|
|
||||||
|
type
|
||||||
|
TSNEntryDlg = class(TForm)
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
SNText: TEdit;
|
||||||
|
CodeText: TEdit;
|
||||||
|
OKBtn: TBitBtn;
|
||||||
|
CancelBtn: TBitBtn;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label4: TLabel;
|
||||||
|
ModString: TEdit;
|
||||||
|
procedure CancelBtnClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
SNEntryDlg: TSNEntryDlg;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
uses
|
||||||
|
OnGuard,
|
||||||
|
OgUtil;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TSNEntryDlg.CancelBtnClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSNEntryDlg.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
LI : longint;
|
||||||
|
begin
|
||||||
|
LI := GenerateMachineModifierPrim;
|
||||||
|
ModString.Text := BufferToHex(LI, SizeOf(longint));
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exdmodu2.lrs}
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
3
components/onguard/examples/exdtp21/datep21.ini
Normal file
3
components/onguard/examples/exdtp21/datep21.ini
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[Codes]
|
||||||
|
|
||||||
|
DateCode=049CF7F37E44F6C6
|
225
components/onguard/examples/exdtp21/exdtp21.lpi
Normal file
225
components/onguard/examples/exdtp21/exdtp21.lpi
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Version Value="6"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value=".\"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="13">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exdtp21.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="9" Y="7"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="21"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exdtp21u.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exdtp21u.lrs"/>
|
||||||
|
<UnitName Value="Exdtp21u"/>
|
||||||
|
<CursorPos X="1" Y="75"/>
|
||||||
|
<TopLine Value="67"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="..\..\source\qogabout0.pas"/>
|
||||||
|
<ComponentName Value="OgAboutForm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qogabout0.lrs"/>
|
||||||
|
<UnitName Value="qogabout0"/>
|
||||||
|
<CursorPos X="1" Y="1"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="..\..\source\qonguard1.pas"/>
|
||||||
|
<ComponentName Value="KeyGenerateFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard1.lrs"/>
|
||||||
|
<UnitName Value="qonguard1"/>
|
||||||
|
<CursorPos X="1" Y="1"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="..\..\source\qonguard2.pas"/>
|
||||||
|
<ComponentName Value="CodeGenerateFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard2.lrs"/>
|
||||||
|
<UnitName Value="qonguard2"/>
|
||||||
|
<CursorPos X="1" Y="1"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit4>
|
||||||
|
<Unit5>
|
||||||
|
<Filename Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<ComponentName Value="KeyMaintFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard3.lrs"/>
|
||||||
|
<UnitName Value="qonguard3"/>
|
||||||
|
<CursorPos X="4" Y="112"/>
|
||||||
|
<TopLine Value="108"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit5>
|
||||||
|
<Unit6>
|
||||||
|
<Filename Value="..\..\source\qonguard4.pas"/>
|
||||||
|
<ComponentName Value="EditProductFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard4.lrs"/>
|
||||||
|
<UnitName Value="qonguard4"/>
|
||||||
|
<CursorPos X="1" Y="1"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit6>
|
||||||
|
<Unit7>
|
||||||
|
<Filename Value="..\..\source\qonguard5.pas"/>
|
||||||
|
<UnitName Value="qonguard5"/>
|
||||||
|
<CursorPos X="73" Y="79"/>
|
||||||
|
<TopLine Value="64"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit7>
|
||||||
|
<Unit8>
|
||||||
|
<Filename Value="..\..\source\qonguard6.pas"/>
|
||||||
|
<ComponentName Value="ModifierFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard6.lrs"/>
|
||||||
|
<UnitName Value="qonguard6"/>
|
||||||
|
<CursorPos X="1" Y="1"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit8>
|
||||||
|
<Unit9>
|
||||||
|
<Filename Value="..\..\source\qonguard7.pas"/>
|
||||||
|
<UnitName Value="qonguard7"/>
|
||||||
|
<CursorPos X="16" Y="35"/>
|
||||||
|
<TopLine Value="67"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit9>
|
||||||
|
<Unit10>
|
||||||
|
<Filename Value="..\..\source\ogconst.pas"/>
|
||||||
|
<UnitName Value="ogconst"/>
|
||||||
|
<CursorPos X="16" Y="35"/>
|
||||||
|
<TopLine Value="18"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit10>
|
||||||
|
<Unit11>
|
||||||
|
<Filename Value="..\..\source\onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="26" Y="1396"/>
|
||||||
|
<TopLine Value="1377"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit11>
|
||||||
|
<Unit12>
|
||||||
|
<Filename Value="..\..\..\..\fpcfix\fpc\rtl\objpas\sysutils\sysinth.inc"/>
|
||||||
|
<CursorPos X="4" Y="48"/>
|
||||||
|
<TopLine Value="31"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit12>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<BreakPoints Count="8">
|
||||||
|
<Item1>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="135"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="143"/>
|
||||||
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="159"/>
|
||||||
|
</Item3>
|
||||||
|
<Item4>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="186"/>
|
||||||
|
</Item4>
|
||||||
|
<Item5>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="212"/>
|
||||||
|
</Item5>
|
||||||
|
<Item6>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="235"/>
|
||||||
|
</Item6>
|
||||||
|
<Item7>
|
||||||
|
<Source Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<Line Value="130"/>
|
||||||
|
</Item7>
|
||||||
|
<Item8>
|
||||||
|
<Source Value="exdtp21u.pas"/>
|
||||||
|
<Line Value="75"/>
|
||||||
|
</Item8>
|
||||||
|
</BreakPoints>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
13
components/onguard/examples/exdtp21/exdtp21.lpr
Normal file
13
components/onguard/examples/exdtp21/exdtp21.lpr
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
program Exdtp21;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
Exdtp21u in 'exdtp21u.pas' {Form1}, tponguard;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
54
components/onguard/examples/exdtp21/exdtp21u.lfm
Normal file
54
components/onguard/examples/exdtp21/exdtp21u.lfm
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 354
|
||||||
|
Height = 155
|
||||||
|
Top = 279
|
||||||
|
Width = 228
|
||||||
|
HorzScrollBar.Page = 227
|
||||||
|
VertScrollBar.Page = 154
|
||||||
|
ActiveControl = Memo1
|
||||||
|
Caption = 'Form1'
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
OnActivate = FormActivate
|
||||||
|
OnCreate = FormCreate
|
||||||
|
Position = poScreenCenter
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 50
|
||||||
|
Height = 13
|
||||||
|
Top = 70
|
||||||
|
Width = 113
|
||||||
|
Caption = 'Expires: 00/00/0000'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 8
|
||||||
|
Height = 59
|
||||||
|
Top = 8
|
||||||
|
Width = 197
|
||||||
|
Lines.Strings = (
|
||||||
|
'If you can edit this, your program '
|
||||||
|
'was '
|
||||||
|
'allowed to run'
|
||||||
|
)
|
||||||
|
ScrollBars = ssVertical
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Left = 56
|
||||||
|
Height = 33
|
||||||
|
Top = 89
|
||||||
|
Width = 89
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object OgDateCode1: TOgDateCode
|
||||||
|
OnChecked = OgDateCode1Checked
|
||||||
|
OnGetKey = OgDateCode1GetKey
|
||||||
|
OnGetCode = OgDateCode1GetCode
|
||||||
|
left = 158
|
||||||
|
top = 87
|
||||||
|
end
|
||||||
|
end
|
19
components/onguard/examples/exdtp21/exdtp21u.lrs
Normal file
19
components/onguard/examples/exdtp21/exdtp21u.lrs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'b'#1#6'Height'#3#155#0#3'Top'#3#23#1#5'Wi'
|
||||||
|
+'dth'#3#228#0#18'HorzScrollBar.Page'#3#227#0#18'VertScrollBar.Page'#3#154#0
|
||||||
|
+#13'ActiveControl'#7#5'Memo1'#7'Caption'#6#5'Form1'#10'Font.Color'#7#7'clBla'
|
||||||
|
+'ck'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#10'OnActivate'#7
|
||||||
|
+#12'FormActivate'#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCent'
|
||||||
|
+'er'#0#6'TLabel'#6'Label1'#4'Left'#2'2'#6'Height'#2#13#3'Top'#2'F'#5'Width'#2
|
||||||
|
+'q'#7'Caption'#6#19'Expires: 00/00/0000'#5'Color'#7#6'clNone'#11'ParentColor'
|
||||||
|
+#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#2';'#3'Top'#2#8#5'Width'#3#197
|
||||||
|
+#0#13'Lines.Strings'#1#6'#If you can edit this, your program '#6#4'was '#6#14
|
||||||
|
+'allowed to run'#0#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#0#0#0#7'TBi'
|
||||||
|
+'tBtn'#8'CloseBtn'#4'Left'#2'8'#6'Height'#2'!'#3'Top'#2'Y'#5'Width'#2'Y'#4'K'
|
||||||
|
+'ind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#11'TOgDateCode'#11'O'
|
||||||
|
+'gDateCode1'#9'OnChecked'#7#18'OgDateCode1Checked'#8'OnGetKey'#7#17'OgDateCo'
|
||||||
|
+'de1GetKey'#9'OnGetCode'#7#18'OgDateCode1GetCode'#4'left'#3#158#0#3'top'#2'W'
|
||||||
|
+#0#0#0
|
||||||
|
]);
|
126
components/onguard/examples/exdtp21/exdtp21u.pas
Normal file
126
components/onguard/examples/exdtp21/exdtp21u.pas
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
(*
|
||||||
|
This example uses the TOgDateCode component. The beginning of the
|
||||||
|
allowed date range is automatically set to the date the program
|
||||||
|
is first run and the expiration date 21 days thereafter
|
||||||
|
*)
|
||||||
|
unit Exdtp21u;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils,Classes,Controls,
|
||||||
|
Forms, Dialogs, StdCtrls, Buttons,LResources, OnGuard,
|
||||||
|
OgUtil,
|
||||||
|
IniFiles;
|
||||||
|
|
||||||
|
const
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
|
||||||
|
$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
OgDateCode1: TOgDateCode;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure FormActivate(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure OgDateCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure OgDateCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure OgDateCode1Checked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
private
|
||||||
|
FExpired : Boolean;
|
||||||
|
public
|
||||||
|
TheDir : string;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{==========================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgDateCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
begin
|
||||||
|
Key := CKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormActivate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FExpired then Application.Terminate;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==========================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgDateCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
var
|
||||||
|
IniFile : TIniFile;
|
||||||
|
S : string;
|
||||||
|
SD,
|
||||||
|
ED : TDateTime;
|
||||||
|
L : integer;
|
||||||
|
begin
|
||||||
|
{force the INI file to be in the same directory as the application}
|
||||||
|
TheDir := ExtractFilePath(ParamStr(0));
|
||||||
|
|
||||||
|
{open Ini File}
|
||||||
|
IniFile := TIniFile.Create(TheDir + 'datep21.ini');
|
||||||
|
try
|
||||||
|
{try to read release code}
|
||||||
|
S := IniFile.ReadString('Codes', 'DateCode', '');
|
||||||
|
|
||||||
|
{If default string returned, create code on the fly}
|
||||||
|
if (S = '') then begin
|
||||||
|
SD := Date;
|
||||||
|
ED := SD + 21.0;
|
||||||
|
InitDateCode(CKey, SD, ED, Code);
|
||||||
|
|
||||||
|
{save string representation of release code to Ini File}
|
||||||
|
S := BufferToHex(Code, SizeOf(Code));
|
||||||
|
IniFile.WriteString('Codes', 'DateCode', S);
|
||||||
|
end else
|
||||||
|
{convert retrieved string to a code}
|
||||||
|
HexToBuffer(S, Code, SizeOf(Code))
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==========================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgDateCode1Checked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
FExpired := false;
|
||||||
|
ShortDateFormat := 'yyy-mm-dd';
|
||||||
|
case Status of
|
||||||
|
ogValidCode : begin
|
||||||
|
Label1.Caption := 'Expires: '
|
||||||
|
+ DateToStr(OgDateCode1.GetValue);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ogPastEndDate : S := 'Past 21 days - please register';
|
||||||
|
|
||||||
|
ogInvalidCode : S := 'Invalid Code';
|
||||||
|
end;
|
||||||
|
ShowMessage(S);
|
||||||
|
FExpired := true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exdtp21u.lrs}
|
||||||
|
|
||||||
|
end.
|
2
components/onguard/examples/exdtreg/ONGUARD.INI
Normal file
2
components/onguard/examples/exdtreg/ONGUARD.INI
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Codes]
|
||||||
|
DateCode=046FEF19C398AE1B
|
104
components/onguard/examples/exdtreg/exdtreg.lpi
Normal file
104
components/onguard/examples/exdtreg/exdtreg.lpi
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Version Value="6"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value=".\"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="3">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exdtreg.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="10" Y="7"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exdtregu.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exdtregu.lrs"/>
|
||||||
|
<UnitName Value="ExDTRegU"/>
|
||||||
|
<CursorPos X="83" Y="62"/>
|
||||||
|
<TopLine Value="36"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="..\..\source\qonguard3.pas"/>
|
||||||
|
<ComponentName Value="KeyMaintFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="..\..\source\qonguard3.lrs"/>
|
||||||
|
<UnitName Value="qonguard3"/>
|
||||||
|
<CursorPos X="1" Y="280"/>
|
||||||
|
<TopLine Value="252"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
<DelphiCompat Value="True"/>
|
||||||
|
<UseAnsiStrings Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
14
components/onguard/examples/exdtreg/exdtreg.lpr
Normal file
14
components/onguard/examples/exdtreg/exdtreg.lpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program ExDTReg;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
exdtregu in 'exdtregu.pas' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
98
components/onguard/examples/exdtreg/exdtregu.lfm
Normal file
98
components/onguard/examples/exdtreg/exdtregu.lfm
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 252
|
||||||
|
Height = 309
|
||||||
|
Top = 138
|
||||||
|
Width = 484
|
||||||
|
HorzScrollBar.Page = 483
|
||||||
|
VertScrollBar.Page = 308
|
||||||
|
BorderStyle = bsDialog
|
||||||
|
Caption = 'Date Code Example'
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Position = poScreenCenter
|
||||||
|
object StatusLbl: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 13
|
||||||
|
Top = 262
|
||||||
|
Width = 35
|
||||||
|
Caption = 'Status'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 240
|
||||||
|
Height = 13
|
||||||
|
Top = 14
|
||||||
|
Width = 77
|
||||||
|
Caption = 'Current code:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object CodeLbl: TLabel
|
||||||
|
Left = 328
|
||||||
|
Height = 13
|
||||||
|
Top = 14
|
||||||
|
Width = 113
|
||||||
|
Caption = '0000000000000000'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object CodeBtn: TButton
|
||||||
|
Left = 8
|
||||||
|
Height = 25
|
||||||
|
Top = 8
|
||||||
|
Width = 89
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Enter Code'
|
||||||
|
OnClick = CodeBtnClick
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 8
|
||||||
|
Height = 209
|
||||||
|
Top = 40
|
||||||
|
Width = 465
|
||||||
|
Color = clBtnFace
|
||||||
|
Lines.Strings = (
|
||||||
|
'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
|
||||||
|
'the code is either the incorrect type or that none has been entered. '
|
||||||
|
''
|
||||||
|
'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
|
||||||
|
'say that the code is invalid.'
|
||||||
|
''
|
||||||
|
'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
|
||||||
|
'the proper "Date" code). '
|
||||||
|
''
|
||||||
|
'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
|
||||||
|
'will cause the TOgDateCode component to report that the code is invalid.'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Left = 400
|
||||||
|
Height = 25
|
||||||
|
Top = 256
|
||||||
|
Width = 75
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object RemoveBtn: TButton
|
||||||
|
Left = 288
|
||||||
|
Height = 25
|
||||||
|
Top = 256
|
||||||
|
Width = 97
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Remove Code'
|
||||||
|
OnClick = RemoveBtnClick
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object OgDateCode1: TOgDateCode
|
||||||
|
OnChecked = CodeChecked
|
||||||
|
OnGetKey = GetKey
|
||||||
|
OnGetCode = GetCode
|
||||||
|
left = 16
|
||||||
|
top = 216
|
||||||
|
end
|
||||||
|
end
|
34
components/onguard/examples/exdtreg/exdtregu.lrs
Normal file
34
components/onguard/examples/exdtreg/exdtregu.lrs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3'5'#1#3'Top'#3#138#0#5'W'
|
||||||
|
+'idth'#3#228#1#18'HorzScrollBar.Page'#3#227#1#18'VertScrollBar.Page'#3'4'#1
|
||||||
|
+#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#17'Date Code Example'#11'Font.He'
|
||||||
|
+'ight'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCente'
|
||||||
|
+'r'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#3#6#1#5'Width'
|
||||||
|
+#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TL'
|
||||||
|
+'abel'#6'Label1'#4'Left'#3#240#0#6'Height'#2#13#3'Top'#2#14#5'Width'#2'M'#7
|
||||||
|
+'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'T'
|
||||||
|
+'Label'#7'CodeLbl'#4'Left'#3'H'#1#6'Height'#2#13#3'Top'#2#14#5'Width'#2'q'#7
|
||||||
|
+'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#7
|
||||||
|
+'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'Y'#25
|
||||||
|
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Code'#7'OnClick'#7#12
|
||||||
|
+'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#3
|
||||||
|
+#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFace'#13'Lines.Strings'
|
||||||
|
+#1#6'fThe label at the bottom of this form indicates the status of the code.'
|
||||||
|
+' An invalid code indicates that '#6'Ethe code is either the incorrect type '
|
||||||
|
+'or that none has been entered. '#6#0#6'^If the proper code has not been ent'
|
||||||
|
+'ered or the ONGUARD.INI file was deleted, the message will '#6#29'say that '
|
||||||
|
+'the code is invalid.'#6#0#6'YUse the "Enter Code" button to enter a code (t'
|
||||||
|
+'he CODEGEN program can be used to generate '#6#25'the proper "Date" code). '
|
||||||
|
+#6#0#6'\The "Remove Code" button can be used to remove the entered code from'
|
||||||
|
+' the INI file. Doing so '#6'Hwill cause the TOgDateCode component to report'
|
||||||
|
+' that the code is invalid.'#0#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#7'TBitBtn'#8
|
||||||
|
+'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'K'#4'Kind'
|
||||||
|
+#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TButton'#9'RemoveBtn'#4
|
||||||
|
+'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'a'#25'BorderSpacing.Inn'
|
||||||
|
+'erBorder'#2#4#7'Caption'#6#11'Remove Code'#7'OnClick'#7#14'RemoveBtnClick'#8
|
||||||
|
+'TabOrder'#2#3#0#0#11'TOgDateCode'#11'OgDateCode1'#9'OnChecked'#7#11'CodeChe'
|
||||||
|
+'cked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7'GetCode'#4'left'#2#16#3'top'
|
||||||
|
+#3#216#0#0#0#0
|
||||||
|
]);
|
130
components/onguard/examples/exdtreg/exdtregu.pas
Normal file
130
components/onguard/examples/exdtreg/exdtregu.pas
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
unit ExDTRegU;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes,Controls, Forms, Dialogs,
|
||||||
|
StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
OgDateCode1: TOgDateCode;
|
||||||
|
CodeBtn: TButton;
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
StatusLbl: TLabel;
|
||||||
|
Label1: TLabel;
|
||||||
|
CodeLbl: TLabel;
|
||||||
|
RemoveBtn: TButton;
|
||||||
|
procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
procedure GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure CodeBtnClick(Sender: TObject);
|
||||||
|
procedure RemoveBtnClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
ShortDateFormat := 'yyyy-mm-dd';
|
||||||
|
case Status of
|
||||||
|
ogValidCode : S := 'Valid Code - Ending date: ' + DateToStr(OgDateCode1.GetValue);
|
||||||
|
ogInvalidCode : S := 'Invalid release code';
|
||||||
|
ogPastEndDate : S := 'Date has expired';
|
||||||
|
ogDayCountUsed : S := 'Zero days of use remaining';
|
||||||
|
ogRunCountUsed : S := 'Usage count has expired';
|
||||||
|
ogNetCountUsed : S := 'Net usage count exceeded';
|
||||||
|
ogCodeExpired : S := 'Code has expired';
|
||||||
|
else
|
||||||
|
S := 'Unknown error';
|
||||||
|
end;
|
||||||
|
StatusLbl.Caption := S;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
const
|
||||||
|
{this applications' key}
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
begin
|
||||||
|
Key := CKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{get the date code from the ini file}
|
||||||
|
S := Ini.ReadString('Codes', 'DateCode', '');
|
||||||
|
{convert to proper form}
|
||||||
|
HexToBuffer(S, Code, SizeOf(Code));
|
||||||
|
{set code label caption}
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.CodeBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
Work : TCode;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
S := '';
|
||||||
|
{ask for code}
|
||||||
|
if InputQuery('Date Code Entry', 'Enter the code', S) then begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{store the date code in the ini file if it looks OK}
|
||||||
|
if HexToBuffer(S, Work, SizeOf(Work)) then begin
|
||||||
|
{save the value}
|
||||||
|
Ini.WriteString('Codes', 'DateCode', S);
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgDateCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RemoveBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
IniFile : TIniFile;
|
||||||
|
begin
|
||||||
|
IniFile := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
IniFile.DeleteKey('Codes', 'DateCode');
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgDateCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exdtregu.lrs}
|
||||||
|
|
||||||
|
end.
|
2
components/onguard/examples/exdyreg/ONGUARD.INI
Normal file
2
components/onguard/examples/exdyreg/ONGUARD.INI
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Codes]
|
||||||
|
DaysCode=B166F4C9600A9E1A
|
122
components/onguard/examples/exdyreg/exdyreg.lpi
Normal file
122
components/onguard/examples/exdyreg/exdyreg.lpi
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="6">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exdyreg.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="48" Y="7"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exdyregu.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exdyregu.lrs"/>
|
||||||
|
<UnitName Value="ExDYRegU"/>
|
||||||
|
<CursorPos X="76" Y="54"/>
|
||||||
|
<TopLine Value="62"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="../../source/qonguard3.pas"/>
|
||||||
|
<ComponentName Value="KeyMaintFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="../../source/qonguard3.lrs"/>
|
||||||
|
<UnitName Value="qonguard3"/>
|
||||||
|
<CursorPos X="1" Y="132"/>
|
||||||
|
<TopLine Value="132"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="../../source/qonguard2.pas"/>
|
||||||
|
<ComponentName Value="CodeGenerateFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="../../source/qonguard2.lrs"/>
|
||||||
|
<UnitName Value="qonguard2"/>
|
||||||
|
<CursorPos X="4" Y="351"/>
|
||||||
|
<TopLine Value="348"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="../../../../fpcfix/fpc/rtl/objpas/sysutils/datih.inc"/>
|
||||||
|
<CursorPos X="11" Y="101"/>
|
||||||
|
<TopLine Value="84"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit4>
|
||||||
|
<Unit5>
|
||||||
|
<Filename Value="../../../../fpcfix/fpc/rtl/objpas/sysutils/dati.inc"/>
|
||||||
|
<CursorPos X="3" Y="123"/>
|
||||||
|
<TopLine Value="120"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit5>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
14
components/onguard/examples/exdyreg/exdyreg.lpr
Normal file
14
components/onguard/examples/exdyreg/exdyreg.lpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program ExDYReg;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
ExDYRegU in 'ExDYRegU.pas' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
99
components/onguard/examples/exdyreg/exdyregu.lfm
Normal file
99
components/onguard/examples/exdyreg/exdyregu.lfm
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 252
|
||||||
|
Height = 303
|
||||||
|
Top = 138
|
||||||
|
Width = 493
|
||||||
|
HorzScrollBar.Page = 492
|
||||||
|
VertScrollBar.Page = 302
|
||||||
|
BorderStyle = bsDialog
|
||||||
|
Caption = 'Days Code Example'
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Position = poScreenCenter
|
||||||
|
object StatusLbl: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 13
|
||||||
|
Top = 262
|
||||||
|
Width = 35
|
||||||
|
Caption = 'Status'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 232
|
||||||
|
Height = 13
|
||||||
|
Top = 14
|
||||||
|
Width = 77
|
||||||
|
Caption = 'Current code:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object CodeLbl: TLabel
|
||||||
|
Left = 320
|
||||||
|
Height = 13
|
||||||
|
Top = 14
|
||||||
|
Width = 113
|
||||||
|
Caption = '0000000000000000'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object CodeBtn: TButton
|
||||||
|
Left = 8
|
||||||
|
Height = 25
|
||||||
|
Top = 8
|
||||||
|
Width = 89
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Enter Code'
|
||||||
|
OnClick = CodeBtnClick
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 8
|
||||||
|
Height = 209
|
||||||
|
Top = 40
|
||||||
|
Width = 465
|
||||||
|
Color = clBtnFace
|
||||||
|
Lines.Strings = (
|
||||||
|
'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
|
||||||
|
'the code is either the incorrect type or that none has been entered. '
|
||||||
|
''
|
||||||
|
'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
|
||||||
|
'say that the code is invalid.'
|
||||||
|
''
|
||||||
|
'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
|
||||||
|
'the proper "Days" code). '
|
||||||
|
''
|
||||||
|
'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
|
||||||
|
'will cause the TOgDaysCode component to report that the code is invalid.'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Left = 400
|
||||||
|
Height = 25
|
||||||
|
Top = 256
|
||||||
|
Width = 75
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object RemoveBtn: TButton
|
||||||
|
Left = 288
|
||||||
|
Height = 25
|
||||||
|
Top = 256
|
||||||
|
Width = 97
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Remove Code'
|
||||||
|
OnClick = RemoveBtnClick
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object OgDaysCode1: TOgDaysCode
|
||||||
|
OnChecked = CodeChecked
|
||||||
|
OnGetKey = GetKey
|
||||||
|
OnGetCode = GetCode
|
||||||
|
OnChangeCode = ChangeCode
|
||||||
|
left = 16
|
||||||
|
top = 208
|
||||||
|
end
|
||||||
|
end
|
34
components/onguard/examples/exdyreg/exdyregu.lrs
Normal file
34
components/onguard/examples/exdyreg/exdyregu.lrs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3'/'#1#3'Top'#3#138#0#5'W'
|
||||||
|
+'idth'#3#237#1#18'HorzScrollBar.Page'#3#236#1#18'VertScrollBar.Page'#3'.'#1
|
||||||
|
+#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#17'Days Code Example'#11'Font.He'
|
||||||
|
+'ight'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCente'
|
||||||
|
+'r'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#3#6#1#5'Width'
|
||||||
|
+#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TL'
|
||||||
|
+'abel'#6'Label1'#4'Left'#3#232#0#6'Height'#2#13#3'Top'#2#14#5'Width'#2'M'#7
|
||||||
|
+'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'T'
|
||||||
|
+'Label'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13#3'Top'#2#14#5'Width'#2'q'#7
|
||||||
|
+'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#7
|
||||||
|
+'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'Y'#25
|
||||||
|
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Code'#7'OnClick'#7#12
|
||||||
|
+'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#3
|
||||||
|
+#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFace'#13'Lines.Strings'
|
||||||
|
+#1#6'fThe label at the bottom of this form indicates the status of the code.'
|
||||||
|
+' An invalid code indicates that '#6'Ethe code is either the incorrect type '
|
||||||
|
+'or that none has been entered. '#6#0#6'^If the proper code has not been ent'
|
||||||
|
+'ered or the ONGUARD.INI file was deleted, the message will '#6#29'say that '
|
||||||
|
+'the code is invalid.'#6#0#6'YUse the "Enter Code" button to enter a code (t'
|
||||||
|
+'he CODEGEN program can be used to generate '#6#25'the proper "Days" code). '
|
||||||
|
+#6#0#6'\The "Remove Code" button can be used to remove the entered code from'
|
||||||
|
+' the INI file. Doing so '#6'Hwill cause the TOgDaysCode component to report'
|
||||||
|
+' that the code is invalid.'#0#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#7'TBitBtn'#8
|
||||||
|
+'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'K'#4'Kind'
|
||||||
|
+#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TButton'#9'RemoveBtn'#4
|
||||||
|
+'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'a'#25'BorderSpacing.Inn'
|
||||||
|
+'erBorder'#2#4#7'Caption'#6#11'Remove Code'#7'OnClick'#7#14'RemoveBtnClick'#8
|
||||||
|
+'TabOrder'#2#3#0#0#11'TOgDaysCode'#11'OgDaysCode1'#9'OnChecked'#7#11'CodeChe'
|
||||||
|
+'cked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7'GetCode'#12'OnChangeCode'#7
|
||||||
|
+#10'ChangeCode'#4'left'#2#16#3'top'#3#208#0#0#0#0
|
||||||
|
]);
|
149
components/onguard/examples/exdyreg/exdyregu.pas
Normal file
149
components/onguard/examples/exdyreg/exdyregu.pas
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
unit ExDYRegU;
|
||||||
|
|
||||||
|
{$H+}
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes,Controls, Forms, Dialogs,
|
||||||
|
StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
CodeBtn: TButton;
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
StatusLbl: TLabel;
|
||||||
|
Label1: TLabel;
|
||||||
|
CodeLbl: TLabel;
|
||||||
|
RemoveBtn: TButton;
|
||||||
|
OgDaysCode1: TOgDaysCode;
|
||||||
|
procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
procedure GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure CodeBtnClick(Sender: TObject);
|
||||||
|
procedure RemoveBtnClick(Sender: TObject);
|
||||||
|
procedure ChangeCode(Sender: TObject; Code: TCode);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
case Status of
|
||||||
|
ogValidCode : S := 'Valid Code - Days remaining: ' + IntToStr(OgDaysCode1.GetValue);
|
||||||
|
ogInvalidCode : S := 'Invalid release code';
|
||||||
|
ogPastEndDate : S := 'Date has expired';
|
||||||
|
ogDayCountUsed : S := 'Zero days of use remaining';
|
||||||
|
ogRunCountUsed : S := 'Usage count has expired';
|
||||||
|
ogNetCountUsed : S := 'Net usage count exceeded';
|
||||||
|
ogCodeExpired : S := 'Code has expired';
|
||||||
|
else
|
||||||
|
S := 'Unknown error';
|
||||||
|
end;
|
||||||
|
StatusLbl.Caption := S;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
const
|
||||||
|
{this applications' key}
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
begin
|
||||||
|
Key := CKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{get the days code from the ini file}
|
||||||
|
S := Ini.ReadString('Codes', 'DaysCode', '');
|
||||||
|
{convert to proper form}
|
||||||
|
HexToBuffer(S, Code, SizeOf(Code));
|
||||||
|
{set code label caption}
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.CodeBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
Work : TCode;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
S := '';
|
||||||
|
{ask for code}
|
||||||
|
if InputQuery('Days Code Entry', 'Enter the code', S) then begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{store the date code in the ini file if it looks OK}
|
||||||
|
if HexToBuffer(S, Work, SizeOf(Work)) then begin
|
||||||
|
{save the value}
|
||||||
|
Ini.WriteString('Codes', 'DaysCode', S);
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgDaysCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RemoveBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
IniFile : TIniFile;
|
||||||
|
begin
|
||||||
|
IniFile := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
IniFile.DeleteKey('Codes', 'DaysCode');
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgDaysCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.ChangeCode(Sender: TObject; Code: TCode);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{store the days code in the ini file}
|
||||||
|
S := BufferToHex(Code, SizeOf(Code));
|
||||||
|
Ini.WriteString('Codes', 'DaysCode', S);
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgDaysCode1.CheckCode(True);
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exdyregu.lrs}
|
||||||
|
|
||||||
|
end.
|
2
components/onguard/examples/exdys30/Days30.INI
Normal file
2
components/onguard/examples/exdys30/Days30.INI
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Codes]
|
||||||
|
DaysCode=82FC3292E294CC3A
|
90
components/onguard/examples/exdys30/exdys30.lpi
Normal file
90
components/onguard/examples/exdys30/exdys30.lpi
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="2">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exdys30.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="10" Y="4"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exdys30u.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exdys30u.lrs"/>
|
||||||
|
<UnitName Value="Exdys30u"/>
|
||||||
|
<CursorPos X="29" Y="69"/>
|
||||||
|
<TopLine Value="50"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
14
components/onguard/examples/exdys30/exdys30.lpr
Normal file
14
components/onguard/examples/exdys30/exdys30.lpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program Exdys30;
|
||||||
|
{$objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
Exdys30u in 'EXDYS30U.PAS' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
52
components/onguard/examples/exdys30/exdys30u.lfm
Normal file
52
components/onguard/examples/exdys30/exdys30u.lfm
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 324
|
||||||
|
Height = 158
|
||||||
|
Top = 260
|
||||||
|
Width = 229
|
||||||
|
HorzScrollBar.Page = 228
|
||||||
|
VertScrollBar.Page = 157
|
||||||
|
Caption = 'Form1'
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Position = poScreenCenter
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 64
|
||||||
|
Height = 13
|
||||||
|
Top = 74
|
||||||
|
Width = 99
|
||||||
|
Alignment = taCenter
|
||||||
|
Caption = 'Days Remaining: '
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 6
|
||||||
|
Height = 45
|
||||||
|
Top = 14
|
||||||
|
Width = 213
|
||||||
|
Lines.Strings = (
|
||||||
|
'If you can edit this, then your program '
|
||||||
|
'was allowed to run'
|
||||||
|
)
|
||||||
|
ScrollBars = ssVertical
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Left = 64
|
||||||
|
Height = 33
|
||||||
|
Top = 92
|
||||||
|
Width = 89
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object OgDaysCode1: TOgDaysCode
|
||||||
|
OnChecked = OgDaysCode1Checked
|
||||||
|
OnGetKey = OgDaysCode1GetKey
|
||||||
|
OnGetCode = OgDaysCode1GetCode
|
||||||
|
OnChangeCode = OgDaysCode1ChangeCode
|
||||||
|
left = 88
|
||||||
|
top = 176
|
||||||
|
end
|
||||||
|
end
|
18
components/onguard/examples/exdys30/exdys30u.lrs
Normal file
18
components/onguard/examples/exdys30/exdys30u.lrs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'D'#1#6'Height'#3#158#0#3'Top'#3#4#1#5'Wid'
|
||||||
|
+'th'#3#229#0#18'HorzScrollBar.Page'#3#228#0#18'VertScrollBar.Page'#3#157#0#7
|
||||||
|
+'Caption'#6#5'Form1'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#245#9'Fon'
|
||||||
|
+'t.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCenter'#0#6'TLabel'#6
|
||||||
|
+'Label1'#4'Left'#2'@'#6'Height'#2#13#3'Top'#2'J'#5'Width'#2'c'#9'Alignment'#7
|
||||||
|
+#8'taCenter'#7'Caption'#6#16'Days Remaining: '#5'Color'#7#6'clNone'#11'Paren'
|
||||||
|
+'tColor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#6#6'Height'#2'-'#3'Top'#2#14#5'Wi'
|
||||||
|
+'dth'#3#213#0#13'Lines.Strings'#1#6'(If you can edit this, then your program'
|
||||||
|
+' '#6#18'was allowed to run'#0#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2
|
||||||
|
+#0#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#2'@'#6'Height'#2'!'#3'Top'#2'\'#5'Widt'
|
||||||
|
+'h'#2'Y'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#11'TOgDay'
|
||||||
|
+'sCode'#11'OgDaysCode1'#9'OnChecked'#7#18'OgDaysCode1Checked'#8'OnGetKey'#7
|
||||||
|
+#17'OgDaysCode1GetKey'#9'OnGetCode'#7#18'OgDaysCode1GetCode'#12'OnChangeCode'
|
||||||
|
+#7#21'OgDaysCode1ChangeCode'#4'left'#2'X'#3'top'#3#176#0#0#0#0
|
||||||
|
]);
|
138
components/onguard/examples/exdys30/exdys30u.pas
Normal file
138
components/onguard/examples/exdys30/exdys30u.pas
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
(*
|
||||||
|
This program uses the TOgDaysCode component. The first time the
|
||||||
|
program is run, the necessary information is created and stored
|
||||||
|
in an INI file. In addition, the program is given a "drop dead"
|
||||||
|
date, i.e., regardless of how many days the program has been used,
|
||||||
|
it cannont be used after that date (1999 December 31).
|
||||||
|
*)
|
||||||
|
unit Exdys30u;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes, Controls,
|
||||||
|
Forms, Dialogs,LResources, StdCtrls, Buttons,
|
||||||
|
OnGuard,OgUtil,IniFiles;
|
||||||
|
|
||||||
|
const
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
|
||||||
|
$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
OgDaysCode1: TOgDaysCode;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure OgDaysCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure OgDaysCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure OgDaysCode1ChangeCode(Sender: TObject; Code: TCode);
|
||||||
|
procedure OgDaysCode1Checked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
TheDir : string;
|
||||||
|
IniFile : TIniFile;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{==========================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgDaysCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
begin
|
||||||
|
Key := CKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==========================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgDaysCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
Expires : TDateTime;
|
||||||
|
L : integer;
|
||||||
|
begin
|
||||||
|
{force the INI file to be in the same directory as the application}
|
||||||
|
TheDir := ExtractFilePath(ParamStr(0));
|
||||||
|
{
|
||||||
|
L := Length(TheDir);
|
||||||
|
if (L > 3) and (TheDir[L] <> '\') then
|
||||||
|
TheDir := TheDir + '\';}
|
||||||
|
|
||||||
|
{open Ini File}
|
||||||
|
IniFile := TIniFile.Create(TheDir + 'Days30.INI');
|
||||||
|
try
|
||||||
|
{try to read release code}
|
||||||
|
S := IniFile.ReadString('Codes', 'DaysCode', 'NoCode');
|
||||||
|
|
||||||
|
{If default string returned, create code on the fly}
|
||||||
|
if (S = 'NoCode') then begin
|
||||||
|
{force absolute ("drop dead") expiration date of 1999 Dec. 31}
|
||||||
|
Expires := EncodeDate(1999, 12, 31);
|
||||||
|
InitDaysCode(CKey, 30, Expires, Code);
|
||||||
|
|
||||||
|
{save string representation of release code to Ini File}
|
||||||
|
S := BufferToHex(Code, SizeOf(Code));
|
||||||
|
IniFile.WriteString('Codes', 'DaysCode', S);
|
||||||
|
end else
|
||||||
|
{convert retrieved string to a code}
|
||||||
|
HexToBuffer(S, Code, SizeOf(Code));
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==========================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgDaysCode1ChangeCode(Sender: TObject; Code: TCode);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
IniFile := TIniFile.Create(TheDir + 'Days30.INI');
|
||||||
|
try
|
||||||
|
{convert Code to string for writing to INI file}
|
||||||
|
S := BufferToHex(Code, SizeOf(Code));
|
||||||
|
IniFile.WriteString('Codes', 'DaysCode', S);
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==========================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgDaysCode1Checked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
case Status of
|
||||||
|
ogValidCode : begin
|
||||||
|
Label1.Caption := 'Days Remaining: '
|
||||||
|
+ IntToStr(OgDaysCode1.GetValue);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ogInvalidCode : S := 'Invalid Code';
|
||||||
|
|
||||||
|
ogDayCountUsed : S := 'Program used more than 30 days' + #13 +
|
||||||
|
'Please register NOW';
|
||||||
|
|
||||||
|
ogCodeExpired : S := 'Evaluation period expired' + #13 +
|
||||||
|
'Please register NOW';
|
||||||
|
end;
|
||||||
|
ShowMessage(S);
|
||||||
|
Application.Terminate;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exdys30u.lrs}
|
||||||
|
|
||||||
|
end.
|
275
components/onguard/examples/exinst/exinst.lpi
Normal file
275
components/onguard/examples/exinst/exinst.lpi
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<AlwaysBuild Value="False"/>
|
||||||
|
</Flags>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="26">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exinst.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="10" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="24"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exinstu.pas"/>
|
||||||
|
<ComponentName Value="FirstInstFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exinstu.lrs"/>
|
||||||
|
<UnitName Value="EXINSTU"/>
|
||||||
|
<CursorPos X="45" Y="22"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="exinstu.lrs"/>
|
||||||
|
<CursorPos X="14" Y="2"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/forms.pp"/>
|
||||||
|
<UnitName Value="Forms"/>
|
||||||
|
<CursorPos X="29" Y="966"/>
|
||||||
|
<TopLine Value="962"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/include/application.inc"/>
|
||||||
|
<CursorPos X="15" Y="298"/>
|
||||||
|
<TopLine Value="297"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit4>
|
||||||
|
<Unit5>
|
||||||
|
<Filename Value="../../../../lazarus0915/fpcsrc/fcl/inc/custapp.pp"/>
|
||||||
|
<UnitName Value="CustApp"/>
|
||||||
|
<CursorPos X="10" Y="200"/>
|
||||||
|
<TopLine Value="198"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit5>
|
||||||
|
<Unit6>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/include/wincontrol.inc"/>
|
||||||
|
<CursorPos X="23" Y="5008"/>
|
||||||
|
<TopLine Value="5004"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit6>
|
||||||
|
<Unit7>
|
||||||
|
<Filename Value="../../source/ogfirst.pas"/>
|
||||||
|
<UnitName Value="ogfirst"/>
|
||||||
|
<CursorPos X="1" Y="186"/>
|
||||||
|
<TopLine Value="168"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit7>
|
||||||
|
<Unit8>
|
||||||
|
<Filename Value="../../../../lazarus0915/fpcsrc/rtl/win32/wininc/ascdef.inc"/>
|
||||||
|
<CursorPos X="13" Y="55"/>
|
||||||
|
<TopLine Value="47"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit8>
|
||||||
|
<Unit9>
|
||||||
|
<Filename Value="../../source/qonguard7.pas"/>
|
||||||
|
<UnitName Value="qonguard7"/>
|
||||||
|
<CursorPos X="33" Y="42"/>
|
||||||
|
<TopLine Value="38"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit9>
|
||||||
|
<Unit10>
|
||||||
|
<Filename Value="../../source/qonguard6.pas"/>
|
||||||
|
<ComponentName Value="ModifierFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="../../source/qonguard6.lrs"/>
|
||||||
|
<UnitName Value="qonguard6"/>
|
||||||
|
<CursorPos X="27" Y="2"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit10>
|
||||||
|
<Unit11>
|
||||||
|
<Filename Value="../../source/qonguard6.lfm"/>
|
||||||
|
<CursorPos X="42" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<SyntaxHighlighter Value="LFM"/>
|
||||||
|
</Unit11>
|
||||||
|
<Unit12>
|
||||||
|
<Filename Value="../../source/qonguard4.pas"/>
|
||||||
|
<ComponentName Value="EditProductFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<UnitName Value="qonguard4"/>
|
||||||
|
<CursorPos X="37" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit12>
|
||||||
|
<Unit13>
|
||||||
|
<Filename Value="../../source/qonguard3.pas"/>
|
||||||
|
<ComponentName Value="KeyMaintFrm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<UnitName Value="qonguard3"/>
|
||||||
|
<CursorPos X="45" Y="9"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit13>
|
||||||
|
<Unit14>
|
||||||
|
<Filename Value="../../source/qonguard4.lfm"/>
|
||||||
|
<CursorPos X="46" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<SyntaxHighlighter Value="LFM"/>
|
||||||
|
</Unit14>
|
||||||
|
<Unit15>
|
||||||
|
<Filename Value="../../source/onguard.inc"/>
|
||||||
|
<CursorPos X="14" Y="25"/>
|
||||||
|
<TopLine Value="42"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit15>
|
||||||
|
<Unit16>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/rtl/linux/ostypes.inc"/>
|
||||||
|
<CursorPos X="30" Y="108"/>
|
||||||
|
<TopLine Value="92"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit16>
|
||||||
|
<Unit17>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/rtl/unix/baseunix.pp"/>
|
||||||
|
<UnitName Value="BaseUnix"/>
|
||||||
|
<CursorPos X="30" Y="56"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit17>
|
||||||
|
<Unit18>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/packages/base/libc/sstath.inc"/>
|
||||||
|
<CursorPos X="38" Y="37"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit18>
|
||||||
|
<Unit19>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/rtl/netwlibc/libc.pp"/>
|
||||||
|
<UnitName Value="libc"/>
|
||||||
|
<CursorPos X="1" Y="1"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit19>
|
||||||
|
<Unit20>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/rtl/netware/nwserv.pp"/>
|
||||||
|
<UnitName Value="nwserv"/>
|
||||||
|
<CursorPos X="1" Y="4630"/>
|
||||||
|
<TopLine Value="4613"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit20>
|
||||||
|
<Unit21>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/packages/base/libc/libc.pp"/>
|
||||||
|
<UnitName Value="libc"/>
|
||||||
|
<CursorPos X="1" Y="57"/>
|
||||||
|
<TopLine Value="41"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit21>
|
||||||
|
<Unit22>
|
||||||
|
<Filename Value="../../source/ogutil.pas"/>
|
||||||
|
<UnitName Value="ogutil"/>
|
||||||
|
<CursorPos X="30" Y="781"/>
|
||||||
|
<TopLine Value="748"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit22>
|
||||||
|
<Unit23>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="1" Y="1"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit23>
|
||||||
|
<Unit24>
|
||||||
|
<Filename Value="../../source/ogfile.pas"/>
|
||||||
|
<UnitName Value="ogfile"/>
|
||||||
|
<CursorPos X="30" Y="140"/>
|
||||||
|
<TopLine Value="121"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit24>
|
||||||
|
<Unit25>
|
||||||
|
<Filename Value="/usr/share/fpcsrc/fcl/db/dbase/dbf_wtil.pas"/>
|
||||||
|
<UnitName Value="dbf_wtil"/>
|
||||||
|
<CursorPos X="39" Y="204"/>
|
||||||
|
<TopLine Value="185"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit25>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<SearchPaths>
|
||||||
|
<OtherUnitFiles Value="../../source/"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<BreakPoints Count="1">
|
||||||
|
<Item1>
|
||||||
|
<Source Value="../../source/ogfirst.pas"/>
|
||||||
|
<Line Value="234"/>
|
||||||
|
</Item1>
|
||||||
|
</BreakPoints>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
23
components/onguard/examples/exinst/exinst.lpr
Normal file
23
components/onguard/examples/exinst/exinst.lpr
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
program Exinst;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,ogfirst,
|
||||||
|
EXINSTU in 'EXINSTU.pas' {FirstInstFrm};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
Application.Initialize;
|
||||||
|
Application.Title := 'First instance example';
|
||||||
|
Application.CreateForm(TFirstInstFrm, FirstInstFrm);
|
||||||
|
|
||||||
|
if IsFirstInstance then
|
||||||
|
Application.Run
|
||||||
|
else
|
||||||
|
ActivateFirstInstance;
|
||||||
|
|
||||||
|
end.
|
42
components/onguard/examples/exinst/exinstu.lfm
Normal file
42
components/onguard/examples/exinst/exinstu.lfm
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
object FirstInstFrm: TFirstInstFrm
|
||||||
|
ActiveControl = Memo1
|
||||||
|
Caption = 'Single Instance Example'
|
||||||
|
ClientHeight = 140
|
||||||
|
ClientWidth = 320
|
||||||
|
Font.Color = clText
|
||||||
|
Font.Height = 11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Font.Pitch = fpVariable
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 18
|
||||||
|
HorzScrollBar.Page = 319
|
||||||
|
HorzScrollBar.Range = 307
|
||||||
|
VertScrollBar.Page = 139
|
||||||
|
VertScrollBar.Range = 129
|
||||||
|
Left = 327
|
||||||
|
Height = 140
|
||||||
|
Top = 218
|
||||||
|
Width = 320
|
||||||
|
object Memo1: TMemo
|
||||||
|
Lines.Strings = (
|
||||||
|
'Attempts to execute this application a second time result in '
|
||||||
|
'the first instance to be activated and the second instance '
|
||||||
|
'terminated.'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 8
|
||||||
|
Height = 89
|
||||||
|
Top = 8
|
||||||
|
Width = 297
|
||||||
|
end
|
||||||
|
object BitBtn2: TBitBtn
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 1
|
||||||
|
Left = 232
|
||||||
|
Height = 25
|
||||||
|
Top = 104
|
||||||
|
Width = 75
|
||||||
|
end
|
||||||
|
end
|
17
components/onguard/examples/exinst/exinstu.lrs
Normal file
17
components/onguard/examples/exinst/exinstu.lrs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TFirstInstFrm','FORMDATA',[
|
||||||
|
'TPF0'#13'TFirstInstFrm'#12'FirstInstFrm'#13'ActiveControl'#7#5'Memo1'#7'Capt'
|
||||||
|
+'ion'#6#23'Single Instance Example'#12'ClientHeight'#3#140#0#11'ClientWidth'
|
||||||
|
+#3'@'#1#10'Font.Color'#7#6'clText'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS'
|
||||||
|
+' Sans Serif'#10'Font.Pitch'#7#10'fpVariable'#13'PixelsPerInch'#2'`'#10'Text'
|
||||||
|
+'Height'#2#18#18'HorzScrollBar.Page'#3'?'#1#19'HorzScrollBar.Range'#3'3'#1#18
|
||||||
|
+'VertScrollBar.Page'#3#139#0#19'VertScrollBar.Range'#3#129#0#4'Left'#3'G'#1#6
|
||||||
|
+'Height'#3#140#0#3'Top'#3#218#0#5'Width'#3'@'#1#0#5'TMemo'#5'Memo1'#13'Lines'
|
||||||
|
+'.Strings'#1#6'=Attempts to execute this application a second time result in'
|
||||||
|
+' '#6';the first instance to be activated and the second instance '#6#11'ter'
|
||||||
|
+'minated.'#0#8'ReadOnly'#9#8'TabOrder'#2#0#4'Left'#2#8#6'Height'#2'Y'#3'Top'
|
||||||
|
+#2#8#5'Width'#3')'#1#0#0#7'TBitBtn'#7'BitBtn2'#4'Kind'#7#7'bkClose'#9'NumGly'
|
||||||
|
+'phs'#2#0#8'TabOrder'#2#1#4'Left'#3#232#0#6'Height'#2#25#3'Top'#2'h'#5'Width'
|
||||||
|
+#2'K'#0#0#0
|
||||||
|
]);
|
30
components/onguard/examples/exinst/exinstu.pas
Normal file
30
components/onguard/examples/exinst/exinstu.pas
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
unit EXINSTU;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes, Graphics,
|
||||||
|
Forms, Dialogs, StdCtrls, Buttons, Controls,LResources;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TFirstInstFrm }
|
||||||
|
|
||||||
|
TFirstInstFrm = class(TForm)
|
||||||
|
Memo1: TMemo;
|
||||||
|
BitBtn2: TBitBtn;
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
FirstInstFrm: TFirstInstFrm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I exinstu.lrs}
|
||||||
|
|
||||||
|
end.
|
272
components/onguard/examples/exmachid/exmachid.lpi
Normal file
272
components/onguard/examples/exmachid/exmachid.lpi
Normal file
@ -0,0 +1,272 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<AlwaysBuild Value="False"/>
|
||||||
|
</Flags>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<Title Value="exmachid"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="2"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="9">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exmachid.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="6" Y="11"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="umachid.pas"/>
|
||||||
|
<ComponentName Value="frmExMachineID"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="umachid.lrs"/>
|
||||||
|
<UnitName Value="uMachID"/>
|
||||||
|
<CursorPos X="26" Y="56"/>
|
||||||
|
<TopLine Value="33"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="../../../source/onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="33" Y="11"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="1" Y="1383"/>
|
||||||
|
<TopLine Value="1366"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/include/control.inc"/>
|
||||||
|
<CursorPos X="29" Y="1533"/>
|
||||||
|
<TopLine Value="1531"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit4>
|
||||||
|
<Unit5>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/include/buttoncontrol.inc"/>
|
||||||
|
<CursorPos X="39" Y="47"/>
|
||||||
|
<TopLine Value="45"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit5>
|
||||||
|
<Unit6>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/include/buttons.inc"/>
|
||||||
|
<CursorPos X="48" Y="233"/>
|
||||||
|
<TopLine Value="230"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit6>
|
||||||
|
<Unit7>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/interfaces/win32/win32proc.pp"/>
|
||||||
|
<UnitName Value="win32proc"/>
|
||||||
|
<CursorPos X="30" Y="557"/>
|
||||||
|
<TopLine Value="554"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit7>
|
||||||
|
<Unit8>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/include/customform.inc"/>
|
||||||
|
<CursorPos X="21" Y="1033"/>
|
||||||
|
<TopLine Value="1032"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit8>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
|
<Position1>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1314" Column="1" TopLine="1297"/>
|
||||||
|
</Position1>
|
||||||
|
<Position2>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1315" Column="1" TopLine="1298"/>
|
||||||
|
</Position2>
|
||||||
|
<Position3>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1316" Column="1" TopLine="1299"/>
|
||||||
|
</Position3>
|
||||||
|
<Position4>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1321" Column="1" TopLine="1304"/>
|
||||||
|
</Position4>
|
||||||
|
<Position5>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1323" Column="1" TopLine="1306"/>
|
||||||
|
</Position5>
|
||||||
|
<Position6>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1324" Column="1" TopLine="1307"/>
|
||||||
|
</Position6>
|
||||||
|
<Position7>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1325" Column="1" TopLine="1308"/>
|
||||||
|
</Position7>
|
||||||
|
<Position8>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1326" Column="1" TopLine="1309"/>
|
||||||
|
</Position8>
|
||||||
|
<Position9>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1328" Column="1" TopLine="1311"/>
|
||||||
|
</Position9>
|
||||||
|
<Position10>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1329" Column="1" TopLine="1312"/>
|
||||||
|
</Position10>
|
||||||
|
<Position11>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1331" Column="1" TopLine="1314"/>
|
||||||
|
</Position11>
|
||||||
|
<Position12>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1333" Column="1" TopLine="1316"/>
|
||||||
|
</Position12>
|
||||||
|
<Position13>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1334" Column="1" TopLine="1317"/>
|
||||||
|
</Position13>
|
||||||
|
<Position14>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1335" Column="1" TopLine="1318"/>
|
||||||
|
</Position14>
|
||||||
|
<Position15>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1336" Column="1" TopLine="1319"/>
|
||||||
|
</Position15>
|
||||||
|
<Position16>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1338" Column="1" TopLine="1321"/>
|
||||||
|
</Position16>
|
||||||
|
<Position17>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1339" Column="1" TopLine="1322"/>
|
||||||
|
</Position17>
|
||||||
|
<Position18>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1341" Column="1" TopLine="1324"/>
|
||||||
|
</Position18>
|
||||||
|
<Position19>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1343" Column="1" TopLine="1326"/>
|
||||||
|
</Position19>
|
||||||
|
<Position20>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1344" Column="1" TopLine="1327"/>
|
||||||
|
</Position20>
|
||||||
|
<Position21>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1345" Column="1" TopLine="1328"/>
|
||||||
|
</Position21>
|
||||||
|
<Position22>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1346" Column="1" TopLine="1329"/>
|
||||||
|
</Position22>
|
||||||
|
<Position23>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1348" Column="1" TopLine="1331"/>
|
||||||
|
</Position23>
|
||||||
|
<Position24>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1349" Column="1" TopLine="1332"/>
|
||||||
|
</Position24>
|
||||||
|
<Position25>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1351" Column="1" TopLine="1334"/>
|
||||||
|
</Position25>
|
||||||
|
<Position26>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1354" Column="1" TopLine="1337"/>
|
||||||
|
</Position26>
|
||||||
|
<Position27>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1357" Column="1" TopLine="1340"/>
|
||||||
|
</Position27>
|
||||||
|
<Position28>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1358" Column="1" TopLine="1341"/>
|
||||||
|
</Position28>
|
||||||
|
<Position29>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1360" Column="1" TopLine="1343"/>
|
||||||
|
</Position29>
|
||||||
|
<Position30>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1369" Column="1" TopLine="1352"/>
|
||||||
|
</Position30>
|
||||||
|
</JumpHistory>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<BreakPoints Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Source Value="../../../source/ogfirst.pas"/>
|
||||||
|
<Line Value="234"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Source Value="../../source/onguard.pas"/>
|
||||||
|
<Line Value="1302"/>
|
||||||
|
</Item2>
|
||||||
|
</BreakPoints>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
15
components/onguard/examples/exmachid/exmachid.lpr
Normal file
15
components/onguard/examples/exmachid/exmachid.lpr
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
program ExMachID;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
umachid in 'umachid.pas';
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TfrmExMachineID,frmExMachineID);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
82
components/onguard/examples/exmachid/umachid.lfm
Normal file
82
components/onguard/examples/exmachid/umachid.lfm
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
object frmExMachineID: TfrmExMachineID
|
||||||
|
ActiveControl = chkUser
|
||||||
|
BorderIcons = [biSystemMenu, biMinimize]
|
||||||
|
Caption = 'ExMachineID'
|
||||||
|
ClientHeight = 174
|
||||||
|
ClientWidth = 240
|
||||||
|
Font.Color = clText
|
||||||
|
Font.Height = 11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Font.Pitch = fpVariable
|
||||||
|
PixelsPerInch = 96
|
||||||
|
Position = poScreenCenter
|
||||||
|
TextHeight = 18
|
||||||
|
HorzScrollBar.Page = 239
|
||||||
|
HorzScrollBar.Range = 209
|
||||||
|
VertScrollBar.Page = 173
|
||||||
|
VertScrollBar.Range = 121
|
||||||
|
Left = 364
|
||||||
|
Height = 174
|
||||||
|
Top = 254
|
||||||
|
Width = 240
|
||||||
|
object GroupBox1: TGroupBox
|
||||||
|
Caption = ' Machine Info Set '
|
||||||
|
ClientHeight = 119
|
||||||
|
ClientWidth = 109
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 8
|
||||||
|
Height = 137
|
||||||
|
Top = 8
|
||||||
|
Width = 113
|
||||||
|
object chkUser: TCheckBox
|
||||||
|
Caption = 'User'
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 24
|
||||||
|
Height = 17
|
||||||
|
Top = 16
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object chkSystem: TCheckBox
|
||||||
|
Caption = 'System'
|
||||||
|
TabOrder = 1
|
||||||
|
Left = 24
|
||||||
|
Height = 17
|
||||||
|
Top = 40
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object chkNetwork: TCheckBox
|
||||||
|
Caption = 'Network'
|
||||||
|
TabOrder = 2
|
||||||
|
Left = 24
|
||||||
|
Height = 17
|
||||||
|
Top = 64
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object chkDrives: TCheckBox
|
||||||
|
Caption = 'Drives'
|
||||||
|
TabOrder = 3
|
||||||
|
Left = 24
|
||||||
|
Height = 17
|
||||||
|
Top = 88
|
||||||
|
Width = 57
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object btnGenerate: TButton
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Generate'
|
||||||
|
OnClick = btnGenerateClick
|
||||||
|
TabOrder = 1
|
||||||
|
Left = 131
|
||||||
|
Height = 25
|
||||||
|
Top = 32
|
||||||
|
Width = 75
|
||||||
|
end
|
||||||
|
object edtMachineID: TEdit
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 2
|
||||||
|
Left = 128
|
||||||
|
Height = 26
|
||||||
|
Top = 72
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
end
|
25
components/onguard/examples/exmachid/umachid.lrs
Normal file
25
components/onguard/examples/exmachid/umachid.lrs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TfrmExMachineID','FORMDATA',[
|
||||||
|
'TPF0'#15'TfrmExMachineID'#14'frmExMachineID'#13'ActiveControl'#7#7'chkUser'
|
||||||
|
+#11'BorderIcons'#11#12'biSystemMenu'#10'biMinimize'#0#7'Caption'#6#11'ExMach'
|
||||||
|
+'ineID'#12'ClientHeight'#3#174#0#11'ClientWidth'#3#240#0#10'Font.Color'#7#6
|
||||||
|
+'clText'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'
|
||||||
|
+#7#10'fpVariable'#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#10
|
||||||
|
+'TextHeight'#2#18#18'HorzScrollBar.Page'#3#239#0#19'HorzScrollBar.Range'#3
|
||||||
|
+#209#0#18'VertScrollBar.Page'#3#173#0#19'VertScrollBar.Range'#2'y'#4'Left'#3
|
||||||
|
+'l'#1#6'Height'#3#174#0#3'Top'#3#254#0#5'Width'#3#240#0#0#9'TGroupBox'#9'Gro'
|
||||||
|
+'upBox1'#7'Caption'#6#18' Machine Info Set '#12'ClientHeight'#2'w'#11'Client'
|
||||||
|
+'Width'#2'm'#8'TabOrder'#2#0#4'Left'#2#8#6'Height'#3#137#0#3'Top'#2#8#5'Widt'
|
||||||
|
+'h'#2'q'#0#9'TCheckBox'#7'chkUser'#7'Caption'#6#4'User'#8'TabOrder'#2#0#4'Le'
|
||||||
|
+'ft'#2#24#6'Height'#2#17#3'Top'#2#16#5'Width'#2'A'#0#0#9'TCheckBox'#9'chkSys'
|
||||||
|
+'tem'#7'Caption'#6#6'System'#8'TabOrder'#2#1#4'Left'#2#24#6'Height'#2#17#3'T'
|
||||||
|
+'op'#2'('#5'Width'#2'A'#0#0#9'TCheckBox'#10'chkNetwork'#7'Caption'#6#7'Netwo'
|
||||||
|
+'rk'#8'TabOrder'#2#2#4'Left'#2#24#6'Height'#2#17#3'Top'#2'@'#5'Width'#2'I'#0
|
||||||
|
+#0#9'TCheckBox'#9'chkDrives'#7'Caption'#6#6'Drives'#8'TabOrder'#2#3#4'Left'#2
|
||||||
|
+#24#6'Height'#2#17#3'Top'#2'X'#5'Width'#2'9'#0#0#0#7'TButton'#11'btnGenerate'
|
||||||
|
+#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#8'Generate'#7'OnClick'#7#16
|
||||||
|
+'btnGenerateClick'#8'TabOrder'#2#1#4'Left'#3#131#0#6'Height'#2#25#3'Top'#2' '
|
||||||
|
+#5'Width'#2'K'#0#0#5'TEdit'#12'edtMachineID'#8'ReadOnly'#9#8'TabOrder'#2#2#4
|
||||||
|
+'Left'#3#128#0#6'Height'#2#26#3'Top'#2'H'#5'Width'#2'Q'#0#0#0
|
||||||
|
]);
|
67
components/onguard/examples/exmachid/umachid.pas
Normal file
67
components/onguard/examples/exmachid/umachid.pas
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
unit uMachID;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes,
|
||||||
|
Graphics, Controls, Forms, Dialogs,Buttons, StdCtrls,LResources;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TfrmExMachineID }
|
||||||
|
|
||||||
|
TfrmExMachineID = class(TForm)
|
||||||
|
GroupBox1: TGroupBox;
|
||||||
|
chkUser: TCheckBox;
|
||||||
|
chkSystem: TCheckBox;
|
||||||
|
chkNetwork: TCheckBox;
|
||||||
|
chkDrives: TCheckBox;
|
||||||
|
btnGenerate: TButton;
|
||||||
|
edtMachineID: TEdit;
|
||||||
|
procedure btnGenerateClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmExMachineID: TfrmExMachineID;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
uses
|
||||||
|
onguard, ogutil;
|
||||||
|
|
||||||
|
procedure TfrmExMachineID.btnGenerateClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
InfoSet : TEsMachineInfoSet;
|
||||||
|
MachineID : Longint;
|
||||||
|
begin
|
||||||
|
{ initialize the machine information set }
|
||||||
|
InfoSet := [];
|
||||||
|
if chkUser.Checked then
|
||||||
|
InfoSet := InfoSet + [midUser];
|
||||||
|
if chkSystem.Checked then
|
||||||
|
InfoSet := InfoSet + [midSystem];
|
||||||
|
if chkNetwork.Checked then
|
||||||
|
InfoSet := InfoSet + [midNetwork];
|
||||||
|
if chkDrives.Checked then
|
||||||
|
InfoSet := InfoSet + [midDrives];
|
||||||
|
|
||||||
|
{ create the machine ID and display in hex }
|
||||||
|
try
|
||||||
|
MachineID := CreateMachineID(InfoSet);
|
||||||
|
edtMachineID.Text := '$' + BufferToHex(MachineID, SizeOf(MachineID));
|
||||||
|
except on E:Exception do
|
||||||
|
ShowMessage(E.Message);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I umachid.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
1
components/onguard/examples/exnet/EXNET.NAF
Normal file
1
components/onguard/examples/exnet/EXNET.NAF
Normal file
@ -0,0 +1 @@
|
|||||||
|
�)�#���g�����4
|
2
components/onguard/examples/exnet/ONGUARD.INI
Normal file
2
components/onguard/examples/exnet/ONGUARD.INI
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Codes]
|
||||||
|
NetCode=241918EC8E3BABBB
|
114
components/onguard/examples/exnet/exnet.lpi
Normal file
114
components/onguard/examples/exnet/exnet.lpi
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<AlwaysBuild Value="False"/>
|
||||||
|
</Flags>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="5">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exnet.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="44" Y="7"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exnetu.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exnetu.lrs"/>
|
||||||
|
<UnitName Value="Exnetu"/>
|
||||||
|
<CursorPos X="53" Y="159"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="../../source/ognetwrk.pas"/>
|
||||||
|
<UnitName Value="ognetwrk"/>
|
||||||
|
<CursorPos X="68" Y="478"/>
|
||||||
|
<TopLine Value="465"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="../../source/ogutil.pas"/>
|
||||||
|
<UnitName Value="ogutil"/>
|
||||||
|
<CursorPos X="28" Y="1334"/>
|
||||||
|
<TopLine Value="1330"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="35" Y="1349"/>
|
||||||
|
<TopLine Value="1344"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit4>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
14
components/onguard/examples/exnet/exnet.lpr
Normal file
14
components/onguard/examples/exnet/exnet.lpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program Exnet;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
Exnetu in 'EXNETU.PAS' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
100
components/onguard/examples/exnet/exnetu.lfm
Normal file
100
components/onguard/examples/exnet/exnetu.lfm
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 258
|
||||||
|
Height = 317
|
||||||
|
Top = 146
|
||||||
|
Width = 490
|
||||||
|
HorzScrollBar.Page = 489
|
||||||
|
VertScrollBar.Page = 316
|
||||||
|
BorderStyle = bsDialog
|
||||||
|
Caption = 'Network Code Example'
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
OnCreate = FormCreate
|
||||||
|
Position = poScreenCenter
|
||||||
|
object StatusLbl: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 13
|
||||||
|
Top = 262
|
||||||
|
Width = 35
|
||||||
|
Caption = 'Status'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 232
|
||||||
|
Height = 13
|
||||||
|
Top = 14
|
||||||
|
Width = 77
|
||||||
|
Caption = 'Current code:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object CodeLbl: TLabel
|
||||||
|
Left = 320
|
||||||
|
Height = 13
|
||||||
|
Top = 14
|
||||||
|
Width = 113
|
||||||
|
Caption = '0000000000000000'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object CodeBtn: TButton
|
||||||
|
Left = 8
|
||||||
|
Height = 25
|
||||||
|
Top = 8
|
||||||
|
Width = 89
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Enter Code'
|
||||||
|
OnClick = CodeBtnClick
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 8
|
||||||
|
Height = 209
|
||||||
|
Top = 40
|
||||||
|
Width = 465
|
||||||
|
Color = clBtnFace
|
||||||
|
Lines.Strings = (
|
||||||
|
'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
|
||||||
|
'the code is either the incorrect type or that none has been entered. '
|
||||||
|
''
|
||||||
|
'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
|
||||||
|
'say that the code is invalid.'
|
||||||
|
''
|
||||||
|
'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
|
||||||
|
'the proper "Usage" code). '
|
||||||
|
''
|
||||||
|
'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
|
||||||
|
'will cause the TOgNetCode component to report that the code is invalid.'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Left = 400
|
||||||
|
Height = 25
|
||||||
|
Top = 256
|
||||||
|
Width = 75
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object RemoveBtn: TButton
|
||||||
|
Left = 288
|
||||||
|
Height = 25
|
||||||
|
Top = 256
|
||||||
|
Width = 97
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Remove Code'
|
||||||
|
OnClick = RemoveBtnClick
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object OgNetCode1: TOgNetCode
|
||||||
|
OnChecked = CodeChecked
|
||||||
|
OnGetKey = GetKey
|
||||||
|
OnGetCode = GetCode
|
||||||
|
FileName = 'EXNET.NAF'
|
||||||
|
left = 16
|
||||||
|
top = 216
|
||||||
|
end
|
||||||
|
end
|
34
components/onguard/examples/exnet/exnetu.lrs
Normal file
34
components/onguard/examples/exnet/exnetu.lrs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#2#1#6'Height'#3'='#1#3'Top'#3#146#0#5'Wid'
|
||||||
|
+'th'#3#234#1#18'HorzScrollBar.Page'#3#233#1#18'VertScrollBar.Page'#3'<'#1#11
|
||||||
|
+'BorderStyle'#7#8'bsDialog'#7'Caption'#6#20'Network Code Example'#11'Font.He'
|
||||||
|
+'ight'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'OnCreate'#7#10'FormCreate'#8
|
||||||
|
+'Position'#7#14'poScreenCenter'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Heigh'
|
||||||
|
+'t'#2#13#3'Top'#3#6#1#5'Width'#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNo'
|
||||||
|
+'ne'#11'ParentColor'#8#0#0#6'TLabel'#6'Label1'#4'Left'#3#232#0#6'Height'#2#13
|
||||||
|
+#3'Top'#2#14#5'Width'#2'M'#7'Caption'#6#13'Current code:'#5'Color'#7#6'clNon'
|
||||||
|
+'e'#11'ParentColor'#8#0#0#6'TLabel'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13
|
||||||
|
+#3'Top'#2#14#5'Width'#2'q'#7'Caption'#6#16'0000000000000000'#5'Color'#7#6'cl'
|
||||||
|
+'None'#11'ParentColor'#8#0#0#7'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25
|
||||||
|
+#3'Top'#2#8#5'Width'#2'Y'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10
|
||||||
|
+'Enter Code'#7'OnClick'#7#12'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Me'
|
||||||
|
+'mo1'#4'Left'#2#8#6'Height'#3#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9
|
||||||
|
+'clBtnFace'#13'Lines.Strings'#1#6'fThe label at the bottom of this form indi'
|
||||||
|
+'cates the status of the code. An invalid code indicates that '#6'Ethe code '
|
||||||
|
+'is either the incorrect type or that none has been entered. '#6#0#6'^If the'
|
||||||
|
+' proper code has not been entered or the ONGUARD.INI file was deleted, the '
|
||||||
|
+'message will '#6#29'say that the code is invalid.'#6#0#6'YUse the "Enter Co'
|
||||||
|
+'de" button to enter a code (the CODEGEN program can be used to generate '#6
|
||||||
|
+#26'the proper "Usage" code). '#6#0#6'\The "Remove Code" button can be used '
|
||||||
|
+'to remove the entered code from the INI file. Doing so '#6'Gwill cause the '
|
||||||
|
+'TOgNetCode component to report that the code is invalid.'#0#8'ReadOnly'#9#8
|
||||||
|
+'TabOrder'#2#1#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'T'
|
||||||
|
+'op'#3#0#1#5'Width'#2'K'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2
|
||||||
|
+#2#0#0#7'TButton'#9'RemoveBtn'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5
|
||||||
|
+'Width'#2'a'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#11'Remove Code'#7
|
||||||
|
+'OnClick'#7#14'RemoveBtnClick'#8'TabOrder'#2#3#0#0#10'TOgNetCode'#10'OgNetCo'
|
||||||
|
+'de1'#9'OnChecked'#7#11'CodeChecked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7
|
||||||
|
+'GetCode'#8'FileName'#6#9'EXNET.NAF'#4'left'#2#16#3'top'#3#216#0#0#0#0
|
||||||
|
]);
|
165
components/onguard/examples/exnet/exnetu.pas
Normal file
165
components/onguard/examples/exnet/exnetu.pas
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
unit Exnetu;
|
||||||
|
{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes,Controls, Forms, Dialogs,
|
||||||
|
StdCtrls, Buttons,LResources, OnGuard, IniFiles, OgUtil, OgNetWrk;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
CodeBtn: TButton;
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
StatusLbl: TLabel;
|
||||||
|
Label1: TLabel;
|
||||||
|
CodeLbl: TLabel;
|
||||||
|
RemoveBtn: TButton;
|
||||||
|
OgNetCode1: TOgNetCode;
|
||||||
|
procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
procedure GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure CodeBtnClick(Sender: TObject);
|
||||||
|
procedure RemoveBtnClick(Sender: TObject);
|
||||||
|
procedure ChangeCode(Sender: TObject; Code: TCode);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
case Status of
|
||||||
|
ogValidCode : S := 'Valid Code - Max Users: ' + IntToStr(OgNetCode1.MaxUsers);
|
||||||
|
ogInvalidCode : S := 'Invalid release code';
|
||||||
|
ogPastEndDate : S := 'Date has expired';
|
||||||
|
ogDayCountUsed : S := 'Zero days of use remaining';
|
||||||
|
ogRunCountUsed : S := 'Usage count has expired';
|
||||||
|
ogNetCountUsed : S := 'Net usage count exceeded';
|
||||||
|
ogCodeExpired : S := 'Code has expired';
|
||||||
|
else
|
||||||
|
S := 'Unknown error';
|
||||||
|
end;
|
||||||
|
StatusLbl.Caption := S;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
const
|
||||||
|
{this applications' key}
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
begin
|
||||||
|
Key := CKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{get the code from the ini file}
|
||||||
|
S := Ini.ReadString('Codes', 'NetCode', '');
|
||||||
|
{convert to proper form}
|
||||||
|
HexToBuffer(S, Code, SizeOf(Code));
|
||||||
|
{set code label caption}
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.CodeBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
Work : TCode;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
S := '';
|
||||||
|
{ask for code}
|
||||||
|
if InputQuery('Net Code Entry', 'Enter the code', S) then begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{store the code in the ini file if it looks OK}
|
||||||
|
if HexToBuffer(S, Work, SizeOf(Work)) then begin
|
||||||
|
{save the value}
|
||||||
|
Ini.WriteString('Codes', 'NetCode', S);
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
|
||||||
|
{if a record in the NAF is already locked, this won't work - use NAFMGR}
|
||||||
|
{when the NAF is not in use}
|
||||||
|
DeleteFile(OgNetCode1.FileName);
|
||||||
|
OgNetCode1.CreateAccessFile;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgNetCode1.CheckCode(True);
|
||||||
|
|
||||||
|
ShowMessage('Exit and restart EXNET.EXE to use the new Network Access File and new settings');
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RemoveBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
IniFile : TIniFile;
|
||||||
|
begin
|
||||||
|
IniFile := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
IniFile.DeleteKey('Codes', 'NetCode');
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgNetCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.ChangeCode(Sender: TObject; Code: TCode);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{store the code in the ini file}
|
||||||
|
S := BufferToHex(Code, SizeOf(Code));
|
||||||
|
Ini.WriteString('Codes', 'NetCode', S);
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgNetCode1.CheckCode(True);
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
Code : TCode;
|
||||||
|
begin
|
||||||
|
{force code label to update}
|
||||||
|
GetCode(Self, Code);
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exnetu.lrs}
|
||||||
|
|
||||||
|
end.
|
88
components/onguard/examples/exprot/exprot.lpi
Normal file
88
components/onguard/examples/exprot/exprot.lpi
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="2"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="3">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exprot.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="30" Y="17"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exprotu.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exprotu.lrs"/>
|
||||||
|
<UnitName Value="EXPROTU"/>
|
||||||
|
<CursorPos X="15" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="../../source/ogproexe.pas"/>
|
||||||
|
<UnitName Value="ogproexe"/>
|
||||||
|
<CursorPos X="1" Y="453"/>
|
||||||
|
<TopLine Value="432"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit2>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<StripSymbols Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
17
components/onguard/examples/exprot/exprot.lpr
Normal file
17
components/onguard/examples/exprot/exprot.lpr
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
program ExProt;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
EXPROTU in 'EXPROTU.pas' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
55
components/onguard/examples/exprot/exprotu.lfm
Normal file
55
components/onguard/examples/exprot/exprotu.lfm
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 258
|
||||||
|
Height = 151
|
||||||
|
Top = 146
|
||||||
|
Width = 446
|
||||||
|
HorzScrollBar.Page = 445
|
||||||
|
HorzScrollBar.Range = 441
|
||||||
|
VertScrollBar.Page = 150
|
||||||
|
VertScrollBar.Range = 145
|
||||||
|
ActiveControl = Memo1
|
||||||
|
Caption = 'Protect Exe Example'
|
||||||
|
Font.Color = clText
|
||||||
|
Font.Height = 11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Font.Pitch = fpVariable
|
||||||
|
Position = poScreenCenter
|
||||||
|
object StatusLbl: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 13
|
||||||
|
Top = 126
|
||||||
|
Width = 35
|
||||||
|
Caption = 'Status'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 8
|
||||||
|
Height = 105
|
||||||
|
Top = 8
|
||||||
|
Width = 433
|
||||||
|
Lines.Strings = (
|
||||||
|
'The label at the bottom of this form indicates the status of the EXE file. '
|
||||||
|
''
|
||||||
|
'If the EXE file has not been stamped, use the StampEXE program to protect it.'
|
||||||
|
''
|
||||||
|
'The EXE file will need to be stamped after each compile since this re-writes the EXE file.'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Left = 360
|
||||||
|
Height = 25
|
||||||
|
Top = 120
|
||||||
|
Width = 75
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object OgProtectExe1: TOgProtectExe
|
||||||
|
OnChecked = OgProtectExe1Checked
|
||||||
|
left = 124
|
||||||
|
top = 120
|
||||||
|
end
|
||||||
|
end
|
20
components/onguard/examples/exprot/exprotu.lrs
Normal file
20
components/onguard/examples/exprot/exprotu.lrs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#2#1#6'Height'#3#151#0#3'Top'#3#146#0#5'Wi'
|
||||||
|
+'dth'#3#190#1#18'HorzScrollBar.Page'#3#189#1#19'HorzScrollBar.Range'#3#185#1
|
||||||
|
+#18'VertScrollBar.Page'#3#150#0#19'VertScrollBar.Range'#3#145#0#13'ActiveCon'
|
||||||
|
+'trol'#7#5'Memo1'#7'Caption'#6#19'Protect Exe Example'#10'Font.Color'#7#6'cl'
|
||||||
|
+'Text'#11'Font.Height'#2#11#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Pitch'#7
|
||||||
|
+#10'fpVariable'#8'Position'#7#14'poScreenCenter'#0#6'TLabel'#9'StatusLbl'#4
|
||||||
|
+'Left'#2#8#6'Height'#2#13#3'Top'#2'~'#5'Width'#2'#'#7'Caption'#6#6'Status'#5
|
||||||
|
+'Color'#7#6'clNone'#11'ParentColor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'He'
|
||||||
|
+'ight'#2'i'#3'Top'#2#8#5'Width'#3#177#1#13'Lines.Strings'#1#6'KThe label at '
|
||||||
|
+'the bottom of this form indicates the status of the EXE file. '#6#0#6'MIf t'
|
||||||
|
+'he EXE file has not been stamped, use the StampEXE program to protect it.'#6
|
||||||
|
+#0#6'ZThe EXE file will need to be stamped after each compile since this re-'
|
||||||
|
+'writes the EXE file.'#0#8'ReadOnly'#9#8'TabOrder'#2#0#0#0#7'TBitBtn'#8'Clos'
|
||||||
|
+'eBtn'#4'Left'#3'h'#1#6'Height'#2#25#3'Top'#2'x'#5'Width'#2'K'#4'Kind'#7#7'b'
|
||||||
|
+'kClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#13'TOgProtectExe'#13'OgProtect'
|
||||||
|
+'Exe1'#9'OnChecked'#7#20'OgProtectExe1Checked'#4'left'#2'|'#3'top'#2'x'#0#0#0
|
||||||
|
]);
|
48
components/onguard/examples/exprot/exprotu.pas
Normal file
48
components/onguard/examples/exprot/exprotu.pas
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
unit EXPROTU;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes,
|
||||||
|
Controls, Forms, Dialogs, StdCtrls, Buttons,LResources
|
||||||
|
,ogutil, ogproexe;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
StatusLbl: TLabel;
|
||||||
|
OgProtectExe1: TOgProtectExe;
|
||||||
|
procedure OgProtectExe1Checked(Sender: TObject; Status: TExeStatus);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.OgProtectExe1Checked(Sender: TObject; Status: TExeStatus);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
case Status of
|
||||||
|
exeSuccess : S := 'EXE file is OK';
|
||||||
|
exeSizeError : S := 'EXE file size has changed';
|
||||||
|
exeIntegrityError : S := 'EXE Integrity Error';
|
||||||
|
exeNotStamped : S := 'EXE file is not stamped';
|
||||||
|
else
|
||||||
|
S := 'Unknown error';
|
||||||
|
end;
|
||||||
|
StatusLbl.Caption := S;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exprotu.lrs}
|
||||||
|
|
||||||
|
end.
|
122
components/onguard/examples/exreg/exreg.lpi
Normal file
122
components/onguard/examples/exreg/exreg.lpi
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<AlwaysBuild Value="False"/>
|
||||||
|
</Flags>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="2">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item2>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="5">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exreg.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="7" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exreg1.pas"/>
|
||||||
|
<ComponentName Value="frmExRegCode"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exreg1.lrs"/>
|
||||||
|
<UnitName Value="ExReg1"/>
|
||||||
|
<CursorPos X="35" Y="90"/>
|
||||||
|
<TopLine Value="62"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="9" Y="679"/>
|
||||||
|
<TopLine Value="714"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="../../../../lazarus0915/lcl/editbtn.pas"/>
|
||||||
|
<UnitName Value="EditBtn"/>
|
||||||
|
<CursorPos X="60" Y="313"/>
|
||||||
|
<TopLine Value="301"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="../../../../lazarus0915/fpcsrc/rtl/objpas/sysutils/datih.inc"/>
|
||||||
|
<CursorPos X="10" Y="114"/>
|
||||||
|
<TopLine Value="101"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit4>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="1" HistoryIndex="0">
|
||||||
|
<Position1>
|
||||||
|
<Filename Value="exreg1.pas"/>
|
||||||
|
<Caret Line="26" Column="68" TopLine="36"/>
|
||||||
|
</Position1>
|
||||||
|
</JumpHistory>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
15
components/onguard/examples/exreg/exreg.lpr
Normal file
15
components/onguard/examples/exreg/exreg.lpr
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
program ExReg;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
ExReg1 in 'ExReg1.pas' {frmExRegCode}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TfrmExRegCode, frmExRegCode);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
186
components/onguard/examples/exreg/exreg1.lfm
Normal file
186
components/onguard/examples/exreg/exreg1.lfm
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
object frmExRegCode: TfrmExRegCode
|
||||||
|
Left = 391
|
||||||
|
Height = 298
|
||||||
|
Top = 180
|
||||||
|
Width = 391
|
||||||
|
HorzScrollBar.Page = 390
|
||||||
|
VertScrollBar.Page = 297
|
||||||
|
BorderStyle = bsDialog
|
||||||
|
Caption = 'Registration Code Example'
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
OnCreate = FormCreate
|
||||||
|
Position = poScreenCenter
|
||||||
|
object GroupBox1: TGroupBox
|
||||||
|
Left = 8
|
||||||
|
Height = 129
|
||||||
|
Top = 8
|
||||||
|
Width = 369
|
||||||
|
Caption = ' Registration Code Generator (vendor site) '
|
||||||
|
TabOrder = 0
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 39
|
||||||
|
Height = 13
|
||||||
|
Top = 28
|
||||||
|
Width = 72
|
||||||
|
Alignment = taRightJustify
|
||||||
|
Caption = 'User Name:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 14
|
||||||
|
Height = 13
|
||||||
|
Top = 60
|
||||||
|
Width = 97
|
||||||
|
Alignment = taRightJustify
|
||||||
|
Caption = 'Expiration Date:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 6
|
||||||
|
Height = 13
|
||||||
|
Top = 92
|
||||||
|
Width = 105
|
||||||
|
Alignment = taRightJustify
|
||||||
|
Caption = 'Registration Code:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object btnGenerate: TSpeedButton
|
||||||
|
Left = 328
|
||||||
|
Height = 22
|
||||||
|
Hint = 'Generate Registration Code'
|
||||||
|
Top = 88
|
||||||
|
Width = 23
|
||||||
|
Color = clBtnFace
|
||||||
|
Glyph.Data = {
|
||||||
|
42010000424D4201000000000000760000002800000011000000110000000100
|
||||||
|
040000000000CC00000000000000000000001000000000000000000000000000
|
||||||
|
8000008000000080800080000000800080008080000080808000C0C0C0000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
|
||||||
|
8888800000008888888888888888800000008888880000088888800000008888
|
||||||
|
0088808008888000000088808088888800888000000088088880008888088000
|
||||||
|
0000880088000008880880000000808880098900808080000000808880089800
|
||||||
|
8880800000008008800898008800800000008088800989008880800000008808
|
||||||
|
8800000888088000000088080880008808088000000088808808888880888000
|
||||||
|
0000888800888080088880000000888888000008888880000000888888888888
|
||||||
|
888880000000
|
||||||
|
}
|
||||||
|
NumGlyphs = 0
|
||||||
|
OnClick = btnGenerateClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
object edtUserName1: TEdit
|
||||||
|
Left = 120
|
||||||
|
Height = 21
|
||||||
|
Top = 24
|
||||||
|
Width = 233
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object edtRegCode1: TEdit
|
||||||
|
Left = 120
|
||||||
|
Height = 21
|
||||||
|
Top = 88
|
||||||
|
Width = 201
|
||||||
|
Color = clBtnFace
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object edDate: TEdit
|
||||||
|
Left = 121
|
||||||
|
Height = 21
|
||||||
|
Top = 57
|
||||||
|
Width = 118
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object GroupBox2: TGroupBox
|
||||||
|
Left = 8
|
||||||
|
Height = 129
|
||||||
|
Top = 152
|
||||||
|
Width = 369
|
||||||
|
Caption = ' Registration Code Verification (client site) '
|
||||||
|
TabOrder = 1
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 38
|
||||||
|
Height = 13
|
||||||
|
Top = 60
|
||||||
|
Width = 73
|
||||||
|
Alignment = taRightJustify
|
||||||
|
Caption = 'User Name:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 6
|
||||||
|
Height = 13
|
||||||
|
Top = 28
|
||||||
|
Width = 105
|
||||||
|
Alignment = taRightJustify
|
||||||
|
Caption = 'Registration Code:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 70
|
||||||
|
Height = 13
|
||||||
|
Top = 92
|
||||||
|
Width = 41
|
||||||
|
Alignment = taRightJustify
|
||||||
|
Caption = 'Status:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object btnVerify: TSpeedButton
|
||||||
|
Left = 224
|
||||||
|
Height = 22
|
||||||
|
Hint = 'Verify Registration Code'
|
||||||
|
Top = 88
|
||||||
|
Width = 23
|
||||||
|
Color = clBtnFace
|
||||||
|
Glyph.Data = {
|
||||||
|
42010000424D4201000000000000760000002800000011000000110000000100
|
||||||
|
040000000000CC00000000000000000000001000000000000000000000000000
|
||||||
|
8000008000000080800080000000800080008080000080808000C0C0C0000000
|
||||||
|
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
|
||||||
|
8888800000008888888888888888800000008888888888888888800000008888
|
||||||
|
8888888888888000000088888888888888888000000088880008888888888000
|
||||||
|
0000888000008808888080000000880098900808008080000000880089800000
|
||||||
|
0000800000008800898000000000800000008800989008888888800000008880
|
||||||
|
0000888888888000000088880008888888888000000088888888888888888000
|
||||||
|
0000888888888888888880000000888888888888888880000000888888888888
|
||||||
|
888880000000
|
||||||
|
}
|
||||||
|
NumGlyphs = 0
|
||||||
|
OnClick = btnVerifyClick
|
||||||
|
ShowHint = True
|
||||||
|
ParentShowHint = False
|
||||||
|
end
|
||||||
|
object edtUserName2: TEdit
|
||||||
|
Left = 120
|
||||||
|
Height = 21
|
||||||
|
Top = 56
|
||||||
|
Width = 233
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object edtRegCode2: TEdit
|
||||||
|
Left = 120
|
||||||
|
Height = 21
|
||||||
|
Top = 24
|
||||||
|
Width = 233
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object edtStatus: TEdit
|
||||||
|
Left = 120
|
||||||
|
Height = 21
|
||||||
|
Top = 88
|
||||||
|
Width = 97
|
||||||
|
Color = clBtnFace
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
69
components/onguard/examples/exreg/exreg1.lrs
Normal file
69
components/onguard/examples/exreg/exreg1.lrs
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TfrmExRegCode','FORMDATA',[
|
||||||
|
'TPF0'#13'TfrmExRegCode'#12'frmExRegCode'#4'Left'#3#135#1#6'Height'#3'*'#1#3
|
||||||
|
+'Top'#3#180#0#5'Width'#3#135#1#18'HorzScrollBar.Page'#3#134#1#18'VertScrollB'
|
||||||
|
+'ar.Page'#3')'#1#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#25'Registration '
|
||||||
|
+'Code Example'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'OnCr'
|
||||||
|
+'eate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#0#9'TGroupBox'#9'Gr'
|
||||||
|
+'oupBox1'#4'Left'#2#8#6'Height'#3#129#0#3'Top'#2#8#5'Width'#3'q'#1#7'Caption'
|
||||||
|
+#6'+ Registration Code Generator (vendor site) '#8'TabOrder'#2#0#0#6'TLabel'
|
||||||
|
+#6'Label1'#4'Left'#2''''#6'Height'#2#13#3'Top'#2#28#5'Width'#2'H'#9'Alignmen'
|
||||||
|
+'t'#7#14'taRightJustify'#7'Caption'#6#10'User Name:'#5'Color'#7#6'clNone'#11
|
||||||
|
+'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#14#6'Height'#2#13#3'Top'#2
|
||||||
|
+'<'#5'Width'#2'a'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#16'Expirati'
|
||||||
|
+'on Date:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label3'#4
|
||||||
|
+'Left'#2#6#6'Height'#2#13#3'Top'#2'\'#5'Width'#2'i'#9'Alignment'#7#14'taRigh'
|
||||||
|
+'tJustify'#7'Caption'#6#18'Registration Code:'#5'Color'#7#6'clNone'#11'Paren'
|
||||||
|
+'tColor'#8#0#0#12'TSpeedButton'#11'btnGenerate'#4'Left'#3'H'#1#6'Height'#2#22
|
||||||
|
+#4'Hint'#6#26'Generate Registration Code'#3'Top'#2'X'#5'Width'#2#23#5'Color'
|
||||||
|
+#7#9'clBtnFace'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0
|
||||||
|
+#0'('#0#0#0#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#16#0
|
||||||
|
+#0#0#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0
|
||||||
|
+#128#128#0#0#128#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255
|
||||||
|
+#0#0#0#255#0#255#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136
|
||||||
|
+#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#0#0#8#136
|
||||||
|
+#136#128#0#0#0#136#136#0#136#128#128#8#136#128#0#0#0#136#128#128#136#136#136
|
||||||
|
+#0#136#128#0#0#0#136#8#136#128#0#136#136#8#128#0#0#0#136#0#136#0#0#8#136#8
|
||||||
|
+#128#0#0#0#128#136#128#9#137#0#128#128#128#0#0#0#128#136#128#8#152#0#136#128
|
||||||
|
+#128#0#0#0#128#8#128#8#152#0#136#0#128#0#0#0#128#136#128#9#137#0#136#128#128
|
||||||
|
+#0#0#0#136#8#136#0#0#8#136#8#128#0#0#0#136#8#8#128#0#136#8#8#128#0#0#0#136
|
||||||
|
+#128#136#8#136#136#128#136#128#0#0#0#136#136#0#136#128#128#8#136#128#0#0#0
|
||||||
|
+#136#136#136#0#0#8#136#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0
|
||||||
|
+#0#9'NumGlyphs'#2#0#7'OnClick'#7#16'btnGenerateClick'#8'ShowHint'#9#14'Paren'
|
||||||
|
+'tShowHint'#8#0#0#5'TEdit'#12'edtUserName1'#4'Left'#2'x'#6'Height'#2#21#3'To'
|
||||||
|
+'p'#2#24#5'Width'#3#233#0#8'TabOrder'#2#0#0#0#5'TEdit'#11'edtRegCode1'#4'Lef'
|
||||||
|
+'t'#2'x'#6'Height'#2#21#3'Top'#2'X'#5'Width'#3#201#0#5'Color'#7#9'clBtnFace'
|
||||||
|
+#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#5'TEdit'#6'edDate'#4'Left'#2'y'#6'Height'
|
||||||
|
+#2#21#3'Top'#2'9'#5'Width'#2'v'#8'TabOrder'#2#2#0#0#0#9'TGroupBox'#9'GroupBo'
|
||||||
|
+'x2'#4'Left'#2#8#6'Height'#3#129#0#3'Top'#3#152#0#5'Width'#3'q'#1#7'Caption'
|
||||||
|
+#6'. Registration Code Verification (client site) '#8'TabOrder'#2#1#0#6'TLab'
|
||||||
|
+'el'#6'Label4'#4'Left'#2'&'#6'Height'#2#13#3'Top'#2'<'#5'Width'#2'I'#9'Align'
|
||||||
|
+'ment'#7#14'taRightJustify'#7'Caption'#6#10'User Name:'#5'Color'#7#6'clNone'
|
||||||
|
+#11'ParentColor'#8#0#0#6'TLabel'#6'Label5'#4'Left'#2#6#6'Height'#2#13#3'Top'
|
||||||
|
+#2#28#5'Width'#2'i'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#18'Regist'
|
||||||
|
+'ration Code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#6'Label6'
|
||||||
|
+#4'Left'#2'F'#6'Height'#2#13#3'Top'#2'\'#5'Width'#2')'#9'Alignment'#7#14'taR'
|
||||||
|
+'ightJustify'#7'Caption'#6#7'Status:'#5'Color'#7#6'clNone'#11'ParentColor'#8
|
||||||
|
+#0#0#12'TSpeedButton'#9'btnVerify'#4'Left'#3#224#0#6'Height'#2#22#4'Hint'#6
|
||||||
|
+#24'Verify Registration Code'#3'Top'#2'X'#5'Width'#2#23#5'Color'#7#9'clBtnFa'
|
||||||
|
+'ce'#10'Glyph.Data'#10'F'#1#0#0'B'#1#0#0'BMB'#1#0#0#0#0#0#0'v'#0#0#0'('#0#0#0
|
||||||
|
+#17#0#0#0#17#0#0#0#1#0#4#0#0#0#0#0#204#0#0#0#0#0#0#0#0#0#0#0#16#0#0#0#0#0#0#0
|
||||||
|
+#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0
|
||||||
|
+#128#128#128#0#192#192#192#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0
|
||||||
|
+#255#0#255#255#0#0#255#255#255#0#136#136#136#136#136#136#136#136#128#0#0#0
|
||||||
|
+#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136#136
|
||||||
|
+#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136
|
||||||
|
+#136#136#128#0#0#0#136#136#0#8#136#136#136#136#128#0#0#0#136#128#0#0#136#8
|
||||||
|
+#136#128#128#0#0#0#136#0#152#144#8#8#0#128#128#0#0#0#136#0#137#128#0#0#0#0
|
||||||
|
+#128#0#0#0#136#0#137#128#0#0#0#0#128#0#0#0#136#0#152#144#8#136#136#136#128#0
|
||||||
|
+#0#0#136#128#0#0#136#136#136#136#128#0#0#0#136#136#0#8#136#136#136#136#128#0
|
||||||
|
+#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136#136#136
|
||||||
|
+#136#128#0#0#0#136#136#136#136#136#136#136#136#128#0#0#0#136#136#136#136#136
|
||||||
|
+#136#136#136#128#0#0#0#9'NumGlyphs'#2#0#7'OnClick'#7#14'btnVerifyClick'#8'Sh'
|
||||||
|
+'owHint'#9#14'ParentShowHint'#8#0#0#5'TEdit'#12'edtUserName2'#4'Left'#2'x'#6
|
||||||
|
+'Height'#2#21#3'Top'#2'8'#5'Width'#3#233#0#8'TabOrder'#2#0#0#0#5'TEdit'#11'e'
|
||||||
|
+'dtRegCode2'#4'Left'#2'x'#6'Height'#2#21#3'Top'#2#24#5'Width'#3#233#0#8'TabO'
|
||||||
|
+'rder'#2#1#0#0#5'TEdit'#9'edtStatus'#4'Left'#2'x'#6'Height'#2#21#3'Top'#2'X'
|
||||||
|
,#5'Width'#2'a'#5'Color'#7#9'clBtnFace'#8'ReadOnly'#9#8'TabOrder'#2#2#0#0#0#0
|
||||||
|
]);
|
97
components/onguard/examples/exreg/exreg1.pas
Normal file
97
components/onguard/examples/exreg/exreg1.pas
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
unit ExReg1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes,Controls, Forms, Dialogs,
|
||||||
|
StdCtrls, ComCtrls, Buttons,LResources, EditBtn;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TfrmExRegCode }
|
||||||
|
|
||||||
|
TfrmExRegCode = class(TForm)
|
||||||
|
edDate: TEdit;
|
||||||
|
GroupBox1: TGroupBox;
|
||||||
|
Label1: TLabel;
|
||||||
|
edtUserName1: TEdit;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
edtRegCode1: TEdit;
|
||||||
|
GroupBox2: TGroupBox;
|
||||||
|
edtUserName2: TEdit;
|
||||||
|
Label4: TLabel;
|
||||||
|
edtRegCode2: TEdit;
|
||||||
|
Label5: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
edtStatus: TEdit;
|
||||||
|
btnGenerate: TSpeedButton;
|
||||||
|
btnVerify: TSpeedButton;
|
||||||
|
procedure btnGenerateClick(Sender: TObject);
|
||||||
|
procedure btnVerifyClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmExRegCode: TfrmExRegCode;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
uses
|
||||||
|
OnGuard, OgUtil;
|
||||||
|
|
||||||
|
const
|
||||||
|
EncryptionKey : TKey = ($E5, $8F, $84, $D6, $92, $C9, $A4, $D8,
|
||||||
|
$1A, $FA, $6F, $8D, $AB, $FC, $DF, $B4);
|
||||||
|
|
||||||
|
|
||||||
|
procedure TfrmExRegCode.btnGenerateClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Key : TKey;
|
||||||
|
Code : TCode;
|
||||||
|
Modifier : Longint;
|
||||||
|
D : TDateTime;
|
||||||
|
begin
|
||||||
|
D := StrToDate(edDate.Text);
|
||||||
|
Key := EncryptionKey;
|
||||||
|
Modifier := StringHashELF(edtUserName1.Text);
|
||||||
|
ApplyModifierToKeyPrim(Modifier, Key, SizeOf(Key));
|
||||||
|
InitRegCode(Key, '', D, Code);
|
||||||
|
edtRegCode1.Text := BufferToHex(Code, SizeOf(Code));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmExRegCode.btnVerifyClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Key : TKey;
|
||||||
|
Code : TCode;
|
||||||
|
Modifier : Longint;
|
||||||
|
begin
|
||||||
|
Key := EncryptionKey;
|
||||||
|
Modifier := StringHashELF(edtUserName2.Text);
|
||||||
|
ApplyModifierToKeyPrim(Modifier, Key, SizeOf(Key));
|
||||||
|
HexToBuffer(edtRegCode2.Text, Code, SizeOf(Code));
|
||||||
|
if IsRegCodeValid(Key, Code) then begin
|
||||||
|
if IsRegCodeExpired(Key, Code) then
|
||||||
|
edtStatus.Text := 'Expired'
|
||||||
|
else
|
||||||
|
edtStatus.Text := 'Valid';
|
||||||
|
end else
|
||||||
|
edtStatus.Text := 'Not Valid';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmExRegCode.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ShortDateFormat := 'yyyy-mm-dd';
|
||||||
|
edDate.Text := DateToStr(Now);
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exreg1.lrs}
|
||||||
|
|
||||||
|
end.
|
3
components/onguard/examples/exrgreg/ONGUARD.INI
Normal file
3
components/onguard/examples/exrgreg/ONGUARD.INI
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[Codes]
|
||||||
|
RegistrationCode=B7972EDE905C8F0A
|
||||||
|
RegistrationStr=945-136-16-73
|
90
components/onguard/examples/exrgreg/exrgreg.lpi
Normal file
90
components/onguard/examples/exrgreg/exrgreg.lpi
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="0"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="2">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exrgreg.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="48" Y="7"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exrgregu.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exrgregu.lrs"/>
|
||||||
|
<UnitName Value="exrgregu"/>
|
||||||
|
<CursorPos X="59" Y="108"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
14
components/onguard/examples/exrgreg/exrgreg.lpr
Normal file
14
components/onguard/examples/exrgreg/exrgreg.lpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program ExRgReg;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
exrgregu in 'exrgregu.pas' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
98
components/onguard/examples/exrgreg/exrgregu.lfm
Normal file
98
components/onguard/examples/exrgreg/exrgregu.lfm
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 252
|
||||||
|
Height = 308
|
||||||
|
Top = 138
|
||||||
|
Width = 493
|
||||||
|
HorzScrollBar.Page = 492
|
||||||
|
VertScrollBar.Page = 307
|
||||||
|
BorderStyle = bsDialog
|
||||||
|
Caption = 'Registration Code Example'
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Position = poScreenCenter
|
||||||
|
object StatusLbl: TLabel
|
||||||
|
Left = 8
|
||||||
|
Height = 13
|
||||||
|
Top = 262
|
||||||
|
Width = 35
|
||||||
|
Caption = 'Status'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 232
|
||||||
|
Height = 13
|
||||||
|
Top = 14
|
||||||
|
Width = 77
|
||||||
|
Caption = 'Current code:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object CodeLbl: TLabel
|
||||||
|
Left = 320
|
||||||
|
Height = 13
|
||||||
|
Top = 14
|
||||||
|
Width = 113
|
||||||
|
Caption = '0000000000000000'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object CodeBtn: TButton
|
||||||
|
Left = 8
|
||||||
|
Height = 25
|
||||||
|
Top = 8
|
||||||
|
Width = 89
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Enter Code'
|
||||||
|
OnClick = CodeBtnClick
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 8
|
||||||
|
Height = 209
|
||||||
|
Top = 40
|
||||||
|
Width = 465
|
||||||
|
Color = clBtnFace
|
||||||
|
Lines.Strings = (
|
||||||
|
'The label at the bottom of this form indicates the status of the code. An invalid code indicates that '
|
||||||
|
'the code is either the incorrect type or that none has been entered. '
|
||||||
|
''
|
||||||
|
'If the proper code has not been entered or the ONGUARD.INI file was deleted, the message will '
|
||||||
|
'say that the code is invalid.'
|
||||||
|
''
|
||||||
|
'Use the "Enter Code" button to enter a code (the CODEGEN program can be used to generate '
|
||||||
|
'the proper "Usage" code). '
|
||||||
|
''
|
||||||
|
'The "Remove Code" button can be used to remove the entered code from the INI file. Doing so '
|
||||||
|
'will cause the TOgRegistrationCode component to report that the code is invalid.'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Left = 400
|
||||||
|
Height = 25
|
||||||
|
Top = 256
|
||||||
|
Width = 75
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object RemoveBtn: TButton
|
||||||
|
Left = 288
|
||||||
|
Height = 25
|
||||||
|
Top = 256
|
||||||
|
Width = 97
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Remove Code'
|
||||||
|
OnClick = RemoveBtnClick
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object OgRegistrationCode1: TOgRegistrationCode
|
||||||
|
OnChecked = CodeChecked
|
||||||
|
OnGetKey = GetKey
|
||||||
|
OnGetCode = GetCode
|
||||||
|
left = 16
|
||||||
|
top = 208
|
||||||
|
end
|
||||||
|
end
|
34
components/onguard/examples/exrgreg/exrgregu.lrs
Normal file
34
components/onguard/examples/exrgreg/exrgregu.lrs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#252#0#6'Height'#3'4'#1#3'Top'#3#138#0#5'W'
|
||||||
|
+'idth'#3#237#1#18'HorzScrollBar.Page'#3#236#1#18'VertScrollBar.Page'#3'3'#1
|
||||||
|
+#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#25'Registration Code Example'#11
|
||||||
|
+'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScre'
|
||||||
|
+'enCenter'#0#6'TLabel'#9'StatusLbl'#4'Left'#2#8#6'Height'#2#13#3'Top'#3#6#1#5
|
||||||
|
+'Width'#2'#'#7'Caption'#6#6'Status'#5'Color'#7#6'clNone'#11'ParentColor'#8#0
|
||||||
|
+#0#6'TLabel'#6'Label1'#4'Left'#3#232#0#6'Height'#2#13#3'Top'#2#14#5'Width'#2
|
||||||
|
+'M'#7'Caption'#6#13'Current code:'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0
|
||||||
|
+#6'TLabel'#7'CodeLbl'#4'Left'#3'@'#1#6'Height'#2#13#3'Top'#2#14#5'Width'#2'q'
|
||||||
|
+#7'Caption'#6#16'0000000000000000'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0
|
||||||
|
+#7'TButton'#7'CodeBtn'#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'Y'#25
|
||||||
|
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#10'Enter Code'#7'OnClick'#7#12
|
||||||
|
+'CodeBtnClick'#8'TabOrder'#2#0#0#0#5'TMemo'#5'Memo1'#4'Left'#2#8#6'Height'#3
|
||||||
|
+#209#0#3'Top'#2'('#5'Width'#3#209#1#5'Color'#7#9'clBtnFace'#13'Lines.Strings'
|
||||||
|
+#1#6'fThe label at the bottom of this form indicates the status of the code.'
|
||||||
|
+' An invalid code indicates that '#6'Ethe code is either the incorrect type '
|
||||||
|
+'or that none has been entered. '#6#0#6'^If the proper code has not been ent'
|
||||||
|
+'ered or the ONGUARD.INI file was deleted, the message will '#6#29'say that '
|
||||||
|
+'the code is invalid.'#6#0#6'YUse the "Enter Code" button to enter a code (t'
|
||||||
|
+'he CODEGEN program can be used to generate '#6#26'the proper "Usage" code).'
|
||||||
|
+' '#6#0#6'\The "Remove Code" button can be used to remove the entered code f'
|
||||||
|
+'rom the INI file. Doing so '#6'Pwill cause the TOgRegistrationCode componen'
|
||||||
|
+'t to report that the code is invalid.'#0#8'ReadOnly'#9#8'TabOrder'#2#1#0#0#7
|
||||||
|
+'TBitBtn'#8'CloseBtn'#4'Left'#3#144#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2
|
||||||
|
+'K'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#2#0#0#7'TButton'#9'R'
|
||||||
|
+'emoveBtn'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2'a'#25'Borde'
|
||||||
|
+'rSpacing.InnerBorder'#2#4#7'Caption'#6#11'Remove Code'#7'OnClick'#7#14'Remo'
|
||||||
|
+'veBtnClick'#8'TabOrder'#2#3#0#0#19'TOgRegistrationCode'#19'OgRegistrationCo'
|
||||||
|
+'de1'#9'OnChecked'#7#11'CodeChecked'#8'OnGetKey'#7#6'GetKey'#9'OnGetCode'#7#7
|
||||||
|
+'GetCode'#4'left'#2#16#3'top'#3#208#0#0#0#0
|
||||||
|
]);
|
137
components/onguard/examples/exrgreg/exrgregu.pas
Normal file
137
components/onguard/examples/exrgreg/exrgregu.pas
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
unit exrgregu;
|
||||||
|
|
||||||
|
{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes,Controls, Forms, Dialogs,
|
||||||
|
StdCtrls, Buttons,LResources,OnGuard, IniFiles, OgUtil;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
CodeBtn: TButton;
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
StatusLbl: TLabel;
|
||||||
|
Label1: TLabel;
|
||||||
|
CodeLbl: TLabel;
|
||||||
|
RemoveBtn: TButton;
|
||||||
|
OgRegistrationCode1: TOgRegistrationCode;
|
||||||
|
procedure CodeChecked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
procedure GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure CodeBtnClick(Sender: TObject);
|
||||||
|
procedure RemoveBtnClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
RegStr : string;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.CodeChecked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
case Status of
|
||||||
|
ogValidCode : S := 'Valid Code - Registration: ' + RegStr;
|
||||||
|
ogInvalidCode : S := 'Invalid release code';
|
||||||
|
ogPastEndDate : S := 'Date has expired';
|
||||||
|
ogDayCountUsed : S := 'Zero days of use remaining';
|
||||||
|
ogRunCountUsed : S := 'Usage count has expired';
|
||||||
|
ogNetCountUsed : S := 'Net usage count exceeded';
|
||||||
|
ogCodeExpired : S := 'Code has expired';
|
||||||
|
else
|
||||||
|
S := 'Unknown error';
|
||||||
|
end;
|
||||||
|
StatusLbl.Caption := S;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
const
|
||||||
|
{this applications' key}
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
begin
|
||||||
|
Key := CKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{get the code from the ini file}
|
||||||
|
S := Ini.ReadString('Codes', 'RegistrationCode', '');
|
||||||
|
RegStr := Ini.ReadString('Codes', 'RegistrationStr', '');
|
||||||
|
{convert to proper form}
|
||||||
|
HexToBuffer(S, Code, SizeOf(Code));
|
||||||
|
{set code label caption}
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.CodeBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Ini : TIniFile;
|
||||||
|
Work : TCode;
|
||||||
|
S : string;
|
||||||
|
begin
|
||||||
|
S := '';
|
||||||
|
{ask for string and code}
|
||||||
|
if InputQuery('Registration String Entry', 'Enter the registration string', RegStr) then begin
|
||||||
|
if InputQuery('Registration Code Entry', 'Enter the code', S) then begin
|
||||||
|
Ini := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
{store the code in the ini file if it looks OK}
|
||||||
|
if HexToBuffer(S, Work, SizeOf(Work)) then begin
|
||||||
|
{save the value}
|
||||||
|
Ini.WriteString('Codes', 'RegistrationCode', S);
|
||||||
|
Ini.WriteString('Codes', 'RegistrationStr', RegStr);
|
||||||
|
CodeLbl.Caption := S;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgRegistrationCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RemoveBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
IniFile : TIniFile;
|
||||||
|
begin
|
||||||
|
IniFile := TIniFile.Create('ONGUARD.INI');
|
||||||
|
try
|
||||||
|
IniFile.DeleteKey('Codes', 'RegistrationCode');
|
||||||
|
IniFile.DeleteKey('Codes', 'RegistrationStr');
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{tell the code component to test the new code, reporting the results}
|
||||||
|
OgRegistrationCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exrgregu.lrs}
|
||||||
|
|
||||||
|
end.
|
3
components/onguard/examples/exrgstr/RegCode.ini
Normal file
3
components/onguard/examples/exrgstr/RegCode.ini
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[Codes]
|
||||||
|
RegStr=Lazarus
|
||||||
|
RegCode=5323D1321979760B
|
123
components/onguard/examples/exrgstr/exrgstr.lpi
Normal file
123
components/onguard/examples/exrgstr/exrgstr.lpi
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="2">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exrgstr.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="48" Y="7"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exrgstru.lrs"/>
|
||||||
|
<UnitName Value="Exrgstru"/>
|
||||||
|
<CursorPos X="24" Y="90"/>
|
||||||
|
<TopLine Value="72"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="8" HistoryIndex="7">
|
||||||
|
<Position1>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<Caret Line="109" Column="77" TopLine="92"/>
|
||||||
|
</Position1>
|
||||||
|
<Position2>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<Caret Line="1" Column="1" TopLine="1"/>
|
||||||
|
</Position2>
|
||||||
|
<Position3>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<Caret Line="67" Column="53" TopLine="49"/>
|
||||||
|
</Position3>
|
||||||
|
<Position4>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<Caret Line="69" Column="54" TopLine="52"/>
|
||||||
|
</Position4>
|
||||||
|
<Position5>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<Caret Line="92" Column="34" TopLine="75"/>
|
||||||
|
</Position5>
|
||||||
|
<Position6>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<Caret Line="103" Column="58" TopLine="86"/>
|
||||||
|
</Position6>
|
||||||
|
<Position7>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<Caret Line="109" Column="73" TopLine="92"/>
|
||||||
|
</Position7>
|
||||||
|
<Position8>
|
||||||
|
<Filename Value="exrgstru.pas"/>
|
||||||
|
<Caret Line="113" Column="42" TopLine="96"/>
|
||||||
|
</Position8>
|
||||||
|
</JumpHistory>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
14
components/onguard/examples/exrgstr/exrgstr.lpr
Normal file
14
components/onguard/examples/exrgstr/exrgstr.lpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program Exrgstr;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
Exrgstru in 'EXRGSTRU.PAS' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
51
components/onguard/examples/exrgstr/exrgstru.lfm
Normal file
51
components/onguard/examples/exrgstr/exrgstru.lfm
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 301
|
||||||
|
Height = 192
|
||||||
|
Top = 218
|
||||||
|
Width = 262
|
||||||
|
HorzScrollBar.Page = 261
|
||||||
|
VertScrollBar.Page = 191
|
||||||
|
Caption = 'Form1'
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Position = poScreenCenter
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 69
|
||||||
|
Height = 13
|
||||||
|
Top = 98
|
||||||
|
Width = 77
|
||||||
|
Alignment = taCenter
|
||||||
|
Caption = 'Registered to:'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 13
|
||||||
|
Height = 79
|
||||||
|
Top = 10
|
||||||
|
Width = 223
|
||||||
|
Lines.Strings = (
|
||||||
|
'If you can edit this, then your program was '
|
||||||
|
'allowed to run'
|
||||||
|
)
|
||||||
|
ScrollBars = ssVertical
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object CloseBtn: TBitBtn
|
||||||
|
Left = 75
|
||||||
|
Height = 33
|
||||||
|
Top = 116
|
||||||
|
Width = 89
|
||||||
|
Kind = bkClose
|
||||||
|
NumGlyphs = 0
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object OgRegistrationCode1: TOgRegistrationCode
|
||||||
|
OnChecked = OgRegistrationCode1Checked
|
||||||
|
OnGetKey = OgRegistrationCode1GetKey
|
||||||
|
OnGetCode = OgRegistrationCode1GetCode
|
||||||
|
left = 165
|
||||||
|
top = 118
|
||||||
|
end
|
||||||
|
end
|
18
components/onguard/examples/exrgstr/exrgstru.lrs
Normal file
18
components/onguard/examples/exrgstr/exrgstru.lrs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'-'#1#6'Height'#3#192#0#3'Top'#3#218#0#5'W'
|
||||||
|
+'idth'#3#6#1#18'HorzScrollBar.Page'#3#5#1#18'VertScrollBar.Page'#3#191#0#7'C'
|
||||||
|
+'aption'#6#5'Form1'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#245#9'Font'
|
||||||
|
+'.Name'#6#13'MS Sans Serif'#8'Position'#7#14'poScreenCenter'#0#6'TLabel'#6'L'
|
||||||
|
+'abel1'#4'Left'#2'E'#6'Height'#2#13#3'Top'#2'b'#5'Width'#2'M'#9'Alignment'#7
|
||||||
|
+#8'taCenter'#7'Caption'#6#14'Registered to:'#5'Color'#7#6'clNone'#11'ParentC'
|
||||||
|
+'olor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#13#6'Height'#2'O'#3'Top'#2#10#5'Wid'
|
||||||
|
+'th'#3#223#0#13'Lines.Strings'#1#6',If you can edit this, then your program '
|
||||||
|
+'was '#6#14'allowed to run'#0#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#0
|
||||||
|
+#0#0#7'TBitBtn'#8'CloseBtn'#4'Left'#2'K'#6'Height'#2'!'#3'Top'#2't'#5'Width'
|
||||||
|
+#2'Y'#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#19'TOgRegist'
|
||||||
|
+'rationCode'#19'OgRegistrationCode1'#9'OnChecked'#7#26'OgRegistrationCode1Ch'
|
||||||
|
+'ecked'#8'OnGetKey'#7#25'OgRegistrationCode1GetKey'#9'OnGetCode'#7#26'OgRegi'
|
||||||
|
+'strationCode1GetCode'#4'left'#3#165#0#3'top'#2'v'#0#0#0
|
||||||
|
]);
|
145
components/onguard/examples/exrgstr/exrgstru.pas
Normal file
145
components/onguard/examples/exrgstr/exrgstru.pas
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
unit Exrgstru;
|
||||||
|
{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils,Classes,Controls,
|
||||||
|
Forms, Dialogs, OnGuard, StdCtrls, Buttons,LResources,
|
||||||
|
|
||||||
|
OgUtil,
|
||||||
|
IniFiles;
|
||||||
|
|
||||||
|
const
|
||||||
|
CKey : TKey = ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,
|
||||||
|
$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4);
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Memo1: TMemo;
|
||||||
|
CloseBtn: TBitBtn;
|
||||||
|
OgRegistrationCode1: TOgRegistrationCode;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure OgRegistrationCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure OgRegistrationCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure OgRegistrationCode1Checked(Sender: TObject;
|
||||||
|
Status: TCodeStatus);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
TheDir,
|
||||||
|
CodeStr,
|
||||||
|
ARegStr : string;
|
||||||
|
IniFile : TIniFile;
|
||||||
|
ED : TDateTime;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{=======================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgRegistrationCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
begin
|
||||||
|
Key := CKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{=======================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgRegistrationCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
var
|
||||||
|
L : integer;
|
||||||
|
begin
|
||||||
|
TheDir := ExtractFilePath(ParamStr(0));
|
||||||
|
{
|
||||||
|
L := Length(TheDir);
|
||||||
|
if (L > 3) and (TheDir[L] <> '\') then
|
||||||
|
TheDir := TheDir + '\';
|
||||||
|
}
|
||||||
|
|
||||||
|
if FileExists(TheDir + 'RegCode.ini') then begin
|
||||||
|
IniFile := TIniFile.Create(TheDir + 'RegCode.ini');
|
||||||
|
try
|
||||||
|
CodeStr := IniFile.ReadString('Codes', 'RegCode', '');
|
||||||
|
HexToBuffer(CodeStr, Code, SizeOf(Code));
|
||||||
|
|
||||||
|
ARegStr := IniFile.ReadString('Codes', 'RegStr', '');
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{=======================================================================}
|
||||||
|
|
||||||
|
procedure TForm1.OgRegistrationCode1Checked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
S,
|
||||||
|
C1 : string;
|
||||||
|
TC : TCode;
|
||||||
|
begin
|
||||||
|
{forced cutoff date of 1999 Dec. 31}
|
||||||
|
ED := EncodeDate(2006, 12, 31);
|
||||||
|
|
||||||
|
case Status of
|
||||||
|
ogValidCode : begin
|
||||||
|
InitRegCode(CKey, ARegStr, ED, TC);
|
||||||
|
C1 := BufferToHex(TC, SizeOf(TC));
|
||||||
|
|
||||||
|
if (CompareText(C1, CodeStr) <> 0) then begin
|
||||||
|
ShowMessage('The Registration Name has been changed');
|
||||||
|
Application.Terminate;
|
||||||
|
end else
|
||||||
|
Label1.Caption := 'Registered to: ' + ARegStr;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ogInvalidCode : begin
|
||||||
|
if not FileExists(TheDir + 'RegCode.ini') then begin
|
||||||
|
if (InputQuery('Codes', 'Reg String', ARegStr)) then begin
|
||||||
|
if (ARegStr = '') then begin
|
||||||
|
S := 'Empty string not allowed';
|
||||||
|
Application.Terminate;
|
||||||
|
end else begin
|
||||||
|
IniFile := TIniFile.Create(TheDir + 'RegCode.ini');
|
||||||
|
try
|
||||||
|
IniFile.WriteString('Codes', 'RegStr', ARegStr);
|
||||||
|
|
||||||
|
InitRegCode(CKey, ARegStr, ED, TC);
|
||||||
|
|
||||||
|
{save string representation of release code to Ini File}
|
||||||
|
CodeStr := BufferToHex(TC, SizeOf(TC));
|
||||||
|
IniFile.WriteString('Codes', 'RegCode', CodeStr);
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
OgRegistrationCode1.CheckCode(True);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
Application.Terminate;
|
||||||
|
end else
|
||||||
|
S := 'Invalid Code';
|
||||||
|
end;
|
||||||
|
|
||||||
|
ogCodeExpired : S := 'Evaluation period expired';
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (Status <> ogValidCode) then begin
|
||||||
|
ShowMessage(S);
|
||||||
|
Application.Terminate;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exrgstru.lrs}
|
||||||
|
|
||||||
|
end.
|
1
components/onguard/examples/exselapi/ExSelect.Dat
Normal file
1
components/onguard/examples/exselapi/ExSelect.Dat
Normal file
@ -0,0 +1 @@
|
|||||||
|
iWݺ�=At���TS��
|
76
components/onguard/examples/exselapi/exselap1.lfm
Normal file
76
components/onguard/examples/exselapi/exselap1.lfm
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 287
|
||||||
|
Height = 266
|
||||||
|
Top = 102
|
||||||
|
Width = 357
|
||||||
|
HorzScrollBar.Page = 356
|
||||||
|
VertScrollBar.Page = 241
|
||||||
|
ActiveControl = Memo1
|
||||||
|
Caption = 'ExSelAPI: '
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Menu = MainMenu1
|
||||||
|
OnCreate = FormCreate
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 16
|
||||||
|
Height = 145
|
||||||
|
Top = 8
|
||||||
|
Width = 313
|
||||||
|
Color = clAqua
|
||||||
|
Lines.Strings = (
|
||||||
|
' This example uses the OgUsageCode and the OgSpecialCode'
|
||||||
|
' (via OnGuard API functions) to implement a limited use'
|
||||||
|
' "demo" application which allows only the required features.'
|
||||||
|
' The program can be run 3 times and then a special code'
|
||||||
|
' must be obtained to register the program and to enable'
|
||||||
|
' various features. A machine modifier is used to prevent'
|
||||||
|
' the application from being copied and run on another'
|
||||||
|
' machine. To obtain the release code you need to run the'
|
||||||
|
' companion example EXSLCODE. The release codes will be '
|
||||||
|
' stored in a data file called EXSELECT.DAT'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object ModifyBtn: TButton
|
||||||
|
Left = 120
|
||||||
|
Height = 25
|
||||||
|
Top = 176
|
||||||
|
Width = 113
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Modify Features'
|
||||||
|
OnClick = ModifyBtnClick
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object MainMenu1: TMainMenu
|
||||||
|
left = 64
|
||||||
|
top = 112
|
||||||
|
object FeaturesMenu: TMenuItem
|
||||||
|
Caption = 'Features'
|
||||||
|
object FeaturesRequired: TMenuItem
|
||||||
|
Caption = 'Required'
|
||||||
|
Checked = True
|
||||||
|
end
|
||||||
|
object FeaturesHelp: TMenuItem
|
||||||
|
Caption = 'Help'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
object FeaturesExamples: TMenuItem
|
||||||
|
Caption = 'Examples'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
object FeaturesDatabase: TMenuItem
|
||||||
|
Caption = 'Database'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
object FeaturesFax: TMenuItem
|
||||||
|
Caption = 'Fax'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
object FeaturesGoodies: TMenuItem
|
||||||
|
Caption = 'Goodies'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
29
components/onguard/examples/exselapi/exselap1.lrs
Normal file
29
components/onguard/examples/exselapi/exselap1.lrs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#31#1#6'Height'#3#10#1#3'Top'#2'f'#5'Width'
|
||||||
|
+#3'e'#1#18'HorzScrollBar.Page'#3'd'#1#18'VertScrollBar.Page'#3#241#0#13'Acti'
|
||||||
|
+'veControl'#7#5'Memo1'#7'Caption'#6#10'ExSelAPI: '#11'Font.Height'#2#245#9'F'
|
||||||
|
+'ont.Name'#6#13'MS Sans Serif'#4'Menu'#7#9'MainMenu1'#8'OnCreate'#7#10'FormC'
|
||||||
|
+'reate'#0#5'TMemo'#5'Memo1'#4'Left'#2#16#6'Height'#3#145#0#3'Top'#2#8#5'Widt'
|
||||||
|
+'h'#3'9'#1#5'Color'#7#6'clAqua'#13'Lines.Strings'#1#6': This example uses '
|
||||||
|
+'the OgUsageCode and the OgSpecialCode'#6'9 (via OnGuard API functions) to'
|
||||||
|
+' implement a limited use'#6'> "demo" application which allows only the re'
|
||||||
|
+'quired features.'#6'9 The program can be run 3 times and then a special c'
|
||||||
|
+'ode'#6'9 must be obtained to register the program and to enable'#6'; va'
|
||||||
|
+'rious features. A machine modifier is used to prevent'#6'7 the applicati'
|
||||||
|
+'on from being copied and run on another'#6'; machine. To obtain the rele'
|
||||||
|
+'ase code you need to run the'#6': companion example EXSLCODE. The releas'
|
||||||
|
+'e codes will be '#6', stored in a data file called EXSELECT.DAT'#0#8'Read'
|
||||||
|
+'Only'#9#8'TabOrder'#2#0#0#0#7'TButton'#9'ModifyBtn'#4'Left'#2'x'#6'Height'#2
|
||||||
|
+#25#3'Top'#3#176#0#5'Width'#2'q'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'
|
||||||
|
+#6#15'Modify Features'#7'OnClick'#7#14'ModifyBtnClick'#8'TabOrder'#2#1#0#0#9
|
||||||
|
+'TMainMenu'#9'MainMenu1'#4'left'#2'@'#3'top'#2'p'#0#9'TMenuItem'#12'Features'
|
||||||
|
+'Menu'#7'Caption'#6#8'Features'#0#9'TMenuItem'#16'FeaturesRequired'#7'Captio'
|
||||||
|
+'n'#6#8'Required'#7'Checked'#9#0#0#9'TMenuItem'#12'FeaturesHelp'#7'Caption'#6
|
||||||
|
+#4'Help'#7'Enabled'#8#0#0#9'TMenuItem'#16'FeaturesExamples'#7'Caption'#6#8'E'
|
||||||
|
+'xamples'#7'Enabled'#8#0#0#9'TMenuItem'#16'FeaturesDatabase'#7'Caption'#6#8
|
||||||
|
+'Database'#7'Enabled'#8#0#0#9'TMenuItem'#11'FeaturesFax'#7'Caption'#6#3'Fax'
|
||||||
|
+#7'Enabled'#8#0#0#9'TMenuItem'#15'FeaturesGoodies'#7'Caption'#6#7'Goodies'#7
|
||||||
|
+'Enabled'#8#0#0#0#0#0
|
||||||
|
]);
|
252
components/onguard/examples/exselapi/exselap1.pas
Normal file
252
components/onguard/examples/exselapi/exselap1.pas
Normal file
@ -0,0 +1,252 @@
|
|||||||
|
{*********************************************************}
|
||||||
|
{* ONGUARD: EXSELAP1.PAS *}
|
||||||
|
{* Copyright (c) TurboPower Software Co 1998 *}
|
||||||
|
{* All rights reserved. *}
|
||||||
|
{*********************************************************}
|
||||||
|
|
||||||
|
{ This example uses the OgUsageCode and the OgSpecialCode
|
||||||
|
(via OnGuard API functions) to implement a limited use
|
||||||
|
"demo" application which allows only the required features.
|
||||||
|
The program can be run 3 times and then a special code
|
||||||
|
must be obtained to register the program and to enable
|
||||||
|
various features. A machine modifier is used to prevent
|
||||||
|
the application from being copied and run on another
|
||||||
|
machine. To obtain the release code you need to run the
|
||||||
|
companion example EXSLCODE. The release codes will be stored
|
||||||
|
in a data file called EXSELECT.DAT}
|
||||||
|
|
||||||
|
unit Exselap1;
|
||||||
|
{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes,Controls, Forms, Dialogs,
|
||||||
|
StdCtrls, Menus,Buttons,LResources,OgUtil,OnGuard;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
ModifyBtn: TButton;
|
||||||
|
Memo1: TMemo;
|
||||||
|
MainMenu1: TMainMenu;
|
||||||
|
FeaturesMenu: TMenuItem;
|
||||||
|
FeaturesRequired: TMenuItem;
|
||||||
|
FeaturesHelp: TMenuItem;
|
||||||
|
FeaturesExamples: TMenuItem;
|
||||||
|
FeaturesDatabase: TMenuItem;
|
||||||
|
FeaturesFax: TMenuItem;
|
||||||
|
FeaturesGoodies: TMenuItem;
|
||||||
|
function FileGetCode(Index : Longint; var Code : TCode) : Boolean;
|
||||||
|
procedure FilePutCode(Index : Longint; Code : TCode);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
function DecodeSpecialCode : Longint;
|
||||||
|
procedure ModifyBtnClick(Sender: TObject);
|
||||||
|
procedure EnableFeatures(Features : Longint);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
{----------------------------------------------------------------------}
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
{ The key was created by a separate program (CODEGEN) and is generic
|
||||||
|
the examples, EXSELECT, EXSELAPI, and EXSLCODE }
|
||||||
|
TheKey: TKey = ($F1,$46,$8D,$E4,$70,$AE,$92,$DC,
|
||||||
|
$13,$1A,$03,$C4,$44,$25,$72,$F5);
|
||||||
|
|
||||||
|
{ Initial code has 3 uses embedded }
|
||||||
|
InitCode : string = '13B1A08BD78AFCD3';
|
||||||
|
CodeFile : string = 'ExSelect.Dat';
|
||||||
|
DemoCaption : string = 'ExSelApi: Demo runs left = ';
|
||||||
|
RegisteredCap : string = 'ExSelApi: Registered';
|
||||||
|
NotRegisteredCap : string = 'ExSelApi: Not Registered';
|
||||||
|
ModifyStr : string = 'Modify Registration to enable this feature';
|
||||||
|
|
||||||
|
{ Feature masks }
|
||||||
|
RequiredMask = $00000001;
|
||||||
|
HelpMask = $00000002;
|
||||||
|
ExamplesMask = $00000004;
|
||||||
|
DBMask = $00000008;
|
||||||
|
FaxMask = $00000010;
|
||||||
|
GoodiesMask = $00000020;
|
||||||
|
|
||||||
|
var
|
||||||
|
UsageCode : TCode; {Index = 0}
|
||||||
|
SpecialCode : TCode; {Index = 1}
|
||||||
|
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
function TForm1.FileGetCode(Index : Longint; var Code : TCode) : Boolean;
|
||||||
|
var
|
||||||
|
Dir, Path : string;
|
||||||
|
FileHandle : Integer;
|
||||||
|
begin
|
||||||
|
Dir := '';
|
||||||
|
GetDir(0, Dir);
|
||||||
|
Path := Dir + DirectorySeparator + CodeFile;
|
||||||
|
FillChar(Code, SizeOf(TCode), 0);
|
||||||
|
if FileExists(Path) then begin
|
||||||
|
FileHandle := FileOpen(Path, fmOpenRead);
|
||||||
|
FileSeek(FileHandle, Index * SizeOf(Code), 0);
|
||||||
|
FileRead(FileHandle, Code, SizeOf(Code));
|
||||||
|
FileClose(FileHandle);
|
||||||
|
Result := True;
|
||||||
|
end else
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.FilePutCode(Index : Longint; Code : TCode);
|
||||||
|
var
|
||||||
|
Dir, Path : string;
|
||||||
|
FileHandle : Integer;
|
||||||
|
begin
|
||||||
|
Dir := '';
|
||||||
|
GetDir(0, Dir);
|
||||||
|
Path := Dir + DirectorySeparator + CodeFile;
|
||||||
|
if not FileExists(Path) then
|
||||||
|
FileHandle := FileCreate(Path)
|
||||||
|
else
|
||||||
|
FileHandle := FileOpen(Path, fmOpenWrite);
|
||||||
|
FileSeek(FileHandle, Index * SizeOf(Code), 0);
|
||||||
|
FileWrite(FileHandle, Code, SizeOf(Code));
|
||||||
|
FileClose(FileHandle);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
FreebiesLeft : Longint;
|
||||||
|
Features : Longint;
|
||||||
|
begin
|
||||||
|
FillChar(SpecialCode, SizeOf(SpecialCode), 0);
|
||||||
|
if not FileGetCode(0, UsageCode) then
|
||||||
|
HexToBuffer(InitCode, UsageCode, SizeOf(UsageCode));
|
||||||
|
FreebiesLeft := GetUsageCodeValue(TheKey, UsageCode);
|
||||||
|
if (FreebiesLeft > 0) then begin {Still in demo phase}
|
||||||
|
DecUsageCode(TheKey, UsageCode);
|
||||||
|
FilePutCode(0, UsageCode);
|
||||||
|
EnableFeatures(RequiredMask);
|
||||||
|
Caption := DemoCaption + IntToStr(FreebiesLeft - 1);
|
||||||
|
end else begin {Registration phase}
|
||||||
|
FileGetCode(1, SpecialCode);
|
||||||
|
Features := DecodeSpecialCode;
|
||||||
|
if (Features <> 0) then begin
|
||||||
|
FilePutCode(1, SpecialCode);
|
||||||
|
EnableFeatures(Features);
|
||||||
|
Caption := RegisteredCap;
|
||||||
|
end else begin
|
||||||
|
EnableFeatures(0);
|
||||||
|
Caption := NotRegisteredCap;
|
||||||
|
end;
|
||||||
|
ModifyBtn.Enabled := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
function TForm1.DecodeSpecialCode : Longint;
|
||||||
|
var
|
||||||
|
CodeStr : string;
|
||||||
|
ModKey : TKey;
|
||||||
|
MachineID : string;
|
||||||
|
Modifier : longint;
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
MachineID := '';
|
||||||
|
Modifier := GenerateMachineModifierPrim;
|
||||||
|
MachineID := BufferToHex(Modifier, SizeOf(Modifier));
|
||||||
|
ModKey := TheKey;
|
||||||
|
ApplyModifierToKeyPrim(Modifier, ModKey, SizeOf(ModKey));
|
||||||
|
{First see if existing Special code is valid}
|
||||||
|
if IsSpecialCodeValid(ModKey, SpecialCode) then begin
|
||||||
|
Result := GetSpecialCodeValue(ModKey, SpecialCode);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
{Otherwise prompt user for Special code}
|
||||||
|
CodeStr := '';
|
||||||
|
if InputQuery('Machine ID: '+ MachineID ,
|
||||||
|
'Run ExSLCODE To Obtain Release Code', CodeStr) then begin
|
||||||
|
HexToBuffer(CodeStr, SpecialCode, SizeOf(SpecialCode));
|
||||||
|
if IsSpecialCodeValid(ModKey, SpecialCode) then
|
||||||
|
Result := GetSpecialCodeValue(ModKey, SpecialCode);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.EnableFeatures(Features : Longint);
|
||||||
|
begin
|
||||||
|
FeaturesRequired.Enabled := False;
|
||||||
|
FeaturesRequired.Checked := False;
|
||||||
|
FeaturesHelp.Enabled := False;
|
||||||
|
FeaturesHelp.Checked := False;
|
||||||
|
FeaturesExamples.Enabled := False;
|
||||||
|
FeaturesExamples.Checked := False;
|
||||||
|
FeaturesDatabase.Enabled := False;
|
||||||
|
FeaturesDatabase.Checked := False;
|
||||||
|
FeaturesFax.Enabled := False;
|
||||||
|
FeaturesFax.Checked := False;
|
||||||
|
FeaturesGoodies.Enabled := False;
|
||||||
|
FeaturesGoodies.Checked := False;
|
||||||
|
if (Features and RequiredMask) <> 0 then begin
|
||||||
|
FeaturesRequired.Enabled := True;
|
||||||
|
FeaturesRequired.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and HelpMask) <> 0 then begin
|
||||||
|
FeaturesHelp.Enabled := True;
|
||||||
|
FeaturesHelp.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and ExamplesMask) <> 0 then begin
|
||||||
|
FeaturesExamples.Enabled := True;
|
||||||
|
FeaturesExamples.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and DBMask) <> 0 then begin
|
||||||
|
FeaturesDatabase.Enabled := True;
|
||||||
|
FeaturesDatabase.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and FaxMask) <> 0 then begin
|
||||||
|
FeaturesFax.Enabled := True;
|
||||||
|
FeaturesFax.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and GoodiesMask) <> 0 then begin
|
||||||
|
FeaturesGoodies.Enabled := True;
|
||||||
|
FeaturesGoodies.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features = 0) then
|
||||||
|
FeaturesMenu.Caption := 'No Features Enabled'
|
||||||
|
else
|
||||||
|
FeaturesMenu.Caption := '&Features';
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.ModifyBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Features : Longint;
|
||||||
|
begin
|
||||||
|
FillChar(SpecialCode, SizeOf(SpecialCode), 0);
|
||||||
|
Features := DecodeSpecialCode;
|
||||||
|
if (Features <> 0) then begin
|
||||||
|
FilePutCode(1, SpecialCode);
|
||||||
|
EnableFeatures(Features);
|
||||||
|
Caption := RegisteredCap;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exselap1.lrs}
|
||||||
|
|
||||||
|
end.
|
230
components/onguard/examples/exselapi/exselapi.lpi
Normal file
230
components/onguard/examples/exselapi/exselapi.lpi
Normal file
@ -0,0 +1,230 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="2"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="8">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exselapi.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="41" Y="14"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="23"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exselap1.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exselap1.lrs"/>
|
||||||
|
<UnitName Value="Exselap1"/>
|
||||||
|
<CursorPos X="12" Y="171"/>
|
||||||
|
<TopLine Value="149"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="12"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="../../source/ogutil.pas"/>
|
||||||
|
<UnitName Value="ogutil"/>
|
||||||
|
<CursorPos X="1" Y="112"/>
|
||||||
|
<TopLine Value="108"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
<Unit3>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<UnitName Value="onguard"/>
|
||||||
|
<CursorPos X="1" Y="1179"/>
|
||||||
|
<TopLine Value="1412"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
|
<UsageCount Value="11"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit3>
|
||||||
|
<Unit4>
|
||||||
|
<Filename Value="../../source/ogproexe.pas"/>
|
||||||
|
<UnitName Value="ogproexe"/>
|
||||||
|
<CursorPos X="63" Y="711"/>
|
||||||
|
<TopLine Value="693"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit4>
|
||||||
|
<Unit5>
|
||||||
|
<Filename Value="../../../../fpcfix/fpc/rtl/unix/sysunixh.inc"/>
|
||||||
|
<CursorPos X="2" Y="30"/>
|
||||||
|
<TopLine Value="13"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit5>
|
||||||
|
<Unit6>
|
||||||
|
<Filename Value="../../../../fpcfix/fpc/rtl/inc/systemh.inc"/>
|
||||||
|
<CursorPos X="32" Y="71"/>
|
||||||
|
<TopLine Value="47"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit6>
|
||||||
|
<Unit7>
|
||||||
|
<Filename Value="../../../../fpcfix/fpc/rtl/objpas/sysutils/filutilh.inc"/>
|
||||||
|
<CursorPos X="3" Y="69"/>
|
||||||
|
<TopLine Value="52"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit7>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="19" HistoryIndex="18">
|
||||||
|
<Position1>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1009" Column="57" TopLine="996"/>
|
||||||
|
</Position1>
|
||||||
|
<Position2>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1010" Column="1" TopLine="993"/>
|
||||||
|
</Position2>
|
||||||
|
<Position3>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1013" Column="1" TopLine="996"/>
|
||||||
|
</Position3>
|
||||||
|
<Position4>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1018" Column="1" TopLine="1001"/>
|
||||||
|
</Position4>
|
||||||
|
<Position5>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1021" Column="1" TopLine="1004"/>
|
||||||
|
</Position5>
|
||||||
|
<Position6>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1022" Column="1" TopLine="1005"/>
|
||||||
|
</Position6>
|
||||||
|
<Position7>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1023" Column="1" TopLine="1006"/>
|
||||||
|
</Position7>
|
||||||
|
<Position8>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1024" Column="1" TopLine="1007"/>
|
||||||
|
</Position8>
|
||||||
|
<Position9>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1027" Column="1" TopLine="1010"/>
|
||||||
|
</Position9>
|
||||||
|
<Position10>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1028" Column="1" TopLine="1011"/>
|
||||||
|
</Position10>
|
||||||
|
<Position11>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1029" Column="1" TopLine="1012"/>
|
||||||
|
</Position11>
|
||||||
|
<Position12>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1030" Column="1" TopLine="1013"/>
|
||||||
|
</Position12>
|
||||||
|
<Position13>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1034" Column="1" TopLine="1017"/>
|
||||||
|
</Position13>
|
||||||
|
<Position14>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1035" Column="1" TopLine="1018"/>
|
||||||
|
</Position14>
|
||||||
|
<Position15>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1036" Column="1" TopLine="1019"/>
|
||||||
|
</Position15>
|
||||||
|
<Position16>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1037" Column="1" TopLine="1020"/>
|
||||||
|
</Position16>
|
||||||
|
<Position17>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1040" Column="1" TopLine="1023"/>
|
||||||
|
</Position17>
|
||||||
|
<Position18>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1041" Column="1" TopLine="1024"/>
|
||||||
|
</Position18>
|
||||||
|
<Position19>
|
||||||
|
<Filename Value="../../source/onguard.pas"/>
|
||||||
|
<Caret Line="1042" Column="1" TopLine="1025"/>
|
||||||
|
</Position19>
|
||||||
|
</JumpHistory>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<SearchPaths>
|
||||||
|
<OtherUnitFiles Value="../../source/"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<BreakPoints Count="3">
|
||||||
|
<Item1>
|
||||||
|
<Source Value="exselap1.pas"/>
|
||||||
|
<Line Value="114"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Source Value="exselap1.pas"/>
|
||||||
|
<Line Value="239"/>
|
||||||
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<Source Value="../../source/onguard.pas"/>
|
||||||
|
<Line Value="1010"/>
|
||||||
|
</Item3>
|
||||||
|
</BreakPoints>
|
||||||
|
<Watches Count="1">
|
||||||
|
<Item1>
|
||||||
|
<Expression Value="buf"/>
|
||||||
|
</Item1>
|
||||||
|
</Watches>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
16
components/onguard/examples/exselapi/exselapi.lpr
Normal file
16
components/onguard/examples/exselapi/exselapi.lpr
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
program Exselapi;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
Exselap1 in 'EXSELAP1.PAS' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
96
components/onguard/examples/exselect/exselec1.lfm
Normal file
96
components/onguard/examples/exselect/exselec1.lfm
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 287
|
||||||
|
Height = 274
|
||||||
|
Top = 102
|
||||||
|
Width = 369
|
||||||
|
HorzScrollBar.Page = 368
|
||||||
|
VertScrollBar.Page = 249
|
||||||
|
ActiveControl = Memo1
|
||||||
|
Caption = 'ExSelect: '
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Menu = MainMenu1
|
||||||
|
OnCreate = FormCreate
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 16
|
||||||
|
Height = 145
|
||||||
|
Top = 8
|
||||||
|
Width = 329
|
||||||
|
Color = clAqua
|
||||||
|
Lines.Strings = (
|
||||||
|
' This example uses the TOgUsageCode and the TOgSpecialCode'
|
||||||
|
' components to implement a limited use "demo" application'
|
||||||
|
' which allows only the required features. The program can be '
|
||||||
|
' run 3 times and then a special code must be obtained to '
|
||||||
|
' register the program and to enable various features. A'
|
||||||
|
' machine modifier is used to prevent the application from being '
|
||||||
|
' copied and run on another machine. To obtain the release '
|
||||||
|
' release code you need to run the companion example '
|
||||||
|
' EXSLCODE. The release codes will be stored in a data file '
|
||||||
|
' called EXSELECT.DAT'
|
||||||
|
)
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object ModifyBtn: TButton
|
||||||
|
Left = 120
|
||||||
|
Height = 25
|
||||||
|
Top = 176
|
||||||
|
Width = 113
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Modify Features'
|
||||||
|
Enabled = False
|
||||||
|
OnClick = ModifyBtnClick
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object MainMenu1: TMainMenu
|
||||||
|
left = 32
|
||||||
|
top = 168
|
||||||
|
object FeaturesMenu: TMenuItem
|
||||||
|
Caption = 'Features'
|
||||||
|
object FeaturesRequired: TMenuItem
|
||||||
|
Caption = 'Required'
|
||||||
|
Checked = True
|
||||||
|
end
|
||||||
|
object FeaturesHelp: TMenuItem
|
||||||
|
Caption = 'Help'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
object FeaturesExamples: TMenuItem
|
||||||
|
Caption = 'Examples'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
object FeaturesDatabase: TMenuItem
|
||||||
|
Caption = 'Database'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
object FeaturesFax: TMenuItem
|
||||||
|
Caption = 'Fax'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
object FeaturesGoodies: TMenuItem
|
||||||
|
Caption = 'Goodies'
|
||||||
|
Enabled = False
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object OgUsageCode1: TOgUsageCode
|
||||||
|
AutoCheck = False
|
||||||
|
OnChecked = OgUsageCode1Checked
|
||||||
|
OnGetKey = OgUsageCode1GetKey
|
||||||
|
OnGetCode = OgUsageCode1GetCode
|
||||||
|
AutoDecrease = False
|
||||||
|
OnChangeCode = OgUsageCode1ChangeCode
|
||||||
|
left = 168
|
||||||
|
top = 48
|
||||||
|
end
|
||||||
|
object OgSpecialCode1: TOgSpecialCode
|
||||||
|
AutoCheck = False
|
||||||
|
OnChecked = OgSpecialCode1Checked
|
||||||
|
OnGetKey = OgSpecialCode1GetKey
|
||||||
|
OnGetCode = OgSpecialCode1GetCode
|
||||||
|
OnGetModifier = OgSpecialCode1GetModifier
|
||||||
|
left = 168
|
||||||
|
top = 16
|
||||||
|
end
|
||||||
|
end
|
36
components/onguard/examples/exselect/exselec1.lrs
Normal file
36
components/onguard/examples/exselect/exselec1.lrs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#31#1#6'Height'#3#18#1#3'Top'#2'f'#5'Width'
|
||||||
|
+#3'q'#1#18'HorzScrollBar.Page'#3'p'#1#18'VertScrollBar.Page'#3#249#0#13'Acti'
|
||||||
|
+'veControl'#7#5'Memo1'#7'Caption'#6#10'ExSelect: '#11'Font.Height'#2#245#9'F'
|
||||||
|
+'ont.Name'#6#13'MS Sans Serif'#4'Menu'#7#9'MainMenu1'#8'OnCreate'#7#10'FormC'
|
||||||
|
+'reate'#0#5'TMemo'#5'Memo1'#4'Left'#2#16#6'Height'#3#145#0#3'Top'#2#8#5'Widt'
|
||||||
|
+'h'#3'I'#1#5'Color'#7#6'clAqua'#13'Lines.Strings'#1#6'< This example uses '
|
||||||
|
+'the TOgUsageCode and the TOgSpecialCode'#6'; components to implement a li'
|
||||||
|
+'mited use "demo" application'#6'@ which allows only the required features'
|
||||||
|
+'. The program can be '#6'< run 3 times and then a special code must be '
|
||||||
|
+'obtained to '#6': register the program and to enable various features. A'
|
||||||
|
+#6'B machine modifier is used to prevent the application from being '#6'= '
|
||||||
|
+' copied and run on another machine. To obtain the release '#6'6 release'
|
||||||
|
+' code you need to run the companion example '#6'> EXSLCODE. The release '
|
||||||
|
+'codes will be stored in a data file '#6#22' called EXSELECT.DAT'#0#8'Read'
|
||||||
|
+'Only'#9#8'TabOrder'#2#0#0#0#7'TButton'#9'ModifyBtn'#4'Left'#2'x'#6'Height'#2
|
||||||
|
+#25#3'Top'#3#176#0#5'Width'#2'q'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'
|
||||||
|
+#6#15'Modify Features'#7'Enabled'#8#7'OnClick'#7#14'ModifyBtnClick'#8'TabOrd'
|
||||||
|
+'er'#2#1#0#0#9'TMainMenu'#9'MainMenu1'#4'left'#2' '#3'top'#3#168#0#0#9'TMenu'
|
||||||
|
+'Item'#12'FeaturesMenu'#7'Caption'#6#8'Features'#0#9'TMenuItem'#16'FeaturesR'
|
||||||
|
+'equired'#7'Caption'#6#8'Required'#7'Checked'#9#0#0#9'TMenuItem'#12'Features'
|
||||||
|
+'Help'#7'Caption'#6#4'Help'#7'Enabled'#8#0#0#9'TMenuItem'#16'FeaturesExample'
|
||||||
|
+'s'#7'Caption'#6#8'Examples'#7'Enabled'#8#0#0#9'TMenuItem'#16'FeaturesDataba'
|
||||||
|
+'se'#7'Caption'#6#8'Database'#7'Enabled'#8#0#0#9'TMenuItem'#11'FeaturesFax'#7
|
||||||
|
+'Caption'#6#3'Fax'#7'Enabled'#8#0#0#9'TMenuItem'#15'FeaturesGoodies'#7'Capti'
|
||||||
|
+'on'#6#7'Goodies'#7'Enabled'#8#0#0#0#0#12'TOgUsageCode'#12'OgUsageCode1'#9'A'
|
||||||
|
+'utoCheck'#8#9'OnChecked'#7#19'OgUsageCode1Checked'#8'OnGetKey'#7#18'OgUsage'
|
||||||
|
+'Code1GetKey'#9'OnGetCode'#7#19'OgUsageCode1GetCode'#12'AutoDecrease'#8#12'O'
|
||||||
|
+'nChangeCode'#7#22'OgUsageCode1ChangeCode'#4'left'#3#168#0#3'top'#2'0'#0#0#14
|
||||||
|
+'TOgSpecialCode'#14'OgSpecialCode1'#9'AutoCheck'#8#9'OnChecked'#7#21'OgSpeci'
|
||||||
|
+'alCode1Checked'#8'OnGetKey'#7#20'OgSpecialCode1GetKey'#9'OnGetCode'#7#21'Og'
|
||||||
|
+'SpecialCode1GetCode'#13'OnGetModifier'#7#25'OgSpecialCode1GetModifier'#4'le'
|
||||||
|
+'ft'#3#168#0#3'top'#2#16#0#0#0
|
||||||
|
]);
|
330
components/onguard/examples/exselect/exselec1.pas
Normal file
330
components/onguard/examples/exselect/exselec1.pas
Normal file
@ -0,0 +1,330 @@
|
|||||||
|
{*********************************************************}
|
||||||
|
{* ONGUARD: EXSELEC1.PAS *}
|
||||||
|
{* Copyright (c) TurboPower Software Co 1998 *}
|
||||||
|
{* All rights reserved. *}
|
||||||
|
{*********************************************************}
|
||||||
|
|
||||||
|
{ This example uses the TOgUsageCode and the TOgSpecialCode
|
||||||
|
components to implement a limited use "demo" application
|
||||||
|
which allows only the required features. The program can
|
||||||
|
be run 3 times and then a special code must be obtained
|
||||||
|
to register the program and to enable various features.
|
||||||
|
A machine modifier is used to prevent the application from
|
||||||
|
being copied and run on another machine. To obtain the
|
||||||
|
release code you need to run the companion example EXSLCODE.
|
||||||
|
The release codes will be stored in a data file called
|
||||||
|
EXSELECT.DAT}
|
||||||
|
|
||||||
|
unit Exselec1;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes, Controls, Forms, Dialogs,
|
||||||
|
StdCtrls, OnGuard, OgUtil, Menus,Buttons,LResources;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
ModifyBtn: TButton;
|
||||||
|
Memo1: TMemo;
|
||||||
|
MainMenu1: TMainMenu;
|
||||||
|
FeaturesMenu: TMenuItem;
|
||||||
|
FeaturesRequired: TMenuItem;
|
||||||
|
FeaturesHelp: TMenuItem;
|
||||||
|
FeaturesExamples: TMenuItem;
|
||||||
|
FeaturesDatabase: TMenuItem;
|
||||||
|
FeaturesFax: TMenuItem;
|
||||||
|
FeaturesGoodies: TMenuItem;
|
||||||
|
OgUsageCode1: TOgUsageCode;
|
||||||
|
OgSpecialCode1: TOgSpecialCode;
|
||||||
|
function DecodeSpecialCode : Longint;
|
||||||
|
procedure ModifyBtnClick(Sender: TObject);
|
||||||
|
procedure EnableFeatures(Features : Longint);
|
||||||
|
procedure OgUsageCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure OgUsageCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure OgUsageCode1Checked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
procedure OgSpecialCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
procedure OgSpecialCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
procedure OgSpecialCode1GetModifier(Sender: TObject;
|
||||||
|
var Value: Longint);
|
||||||
|
procedure OgSpecialCode1Checked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
function FileGetCode(Index : Longint; var Code : TCode) : Boolean;
|
||||||
|
procedure FilePutCode(Index : Longint; Code : TCode);
|
||||||
|
procedure OgUsageCode1ChangeCode(Sender: TObject; Code: TCode);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
{----------------------------------------------------------------------}
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
{ The key was created by a separate program (CODEGEN) and is generic
|
||||||
|
the examples, EXSELECT, EXSELAPI, and EXSLCODE }
|
||||||
|
TheKey: TKey = ($F1,$46,$8D,$E4,$70,$AE,$92,$DC,
|
||||||
|
$13,$1A,$03,$C4,$44,$25,$72,$F5);
|
||||||
|
|
||||||
|
{ Initial code has 3 uses embedded }
|
||||||
|
InitCode : string = '13B1A08BD78AFCD3';
|
||||||
|
CodeFile : string = 'ExSelect.Dat';
|
||||||
|
DemoCaption : string = 'ExSelect: Demo runs left = ';
|
||||||
|
RegisteredCap : string = 'ExSelect: Registered';
|
||||||
|
NotRegisteredCap : string = 'ExSelect: Not Registered';
|
||||||
|
ModifyStr : string = 'Modify Registration to enable this feature';
|
||||||
|
|
||||||
|
{ Feature masks }
|
||||||
|
RequiredMask = $00000001;
|
||||||
|
HelpMask = $00000002;
|
||||||
|
ExamplesMask = $00000004;
|
||||||
|
DBMask = $00000008;
|
||||||
|
FaxMask = $00000010;
|
||||||
|
GoodiesMask = $00000020;
|
||||||
|
|
||||||
|
var
|
||||||
|
UsageCode : TCode; {Index = 0}
|
||||||
|
SpecialCode : TCode; {Index = 1}
|
||||||
|
|
||||||
|
|
||||||
|
{=========== Initialization and File I/O ===============}
|
||||||
|
|
||||||
|
function TForm1.FileGetCode(Index : Longint; var Code : TCode) : Boolean;
|
||||||
|
var
|
||||||
|
Dir, Path : string;
|
||||||
|
FileHandle : Integer;
|
||||||
|
begin
|
||||||
|
Dir := '';
|
||||||
|
GetDir(0, Dir);
|
||||||
|
Path := Dir + DirectorySeparator + CodeFile;
|
||||||
|
FillChar(Code, SizeOf(TCode), 0);
|
||||||
|
if FileExists(Path) then begin
|
||||||
|
FileHandle := FileOpen(Path, fmOpenRead);
|
||||||
|
FileSeek(FileHandle, Index * SizeOf(Code), 0);
|
||||||
|
FileRead(FileHandle, Code, SizeOf(Code));
|
||||||
|
FileClose(FileHandle);
|
||||||
|
Result := True;
|
||||||
|
end else
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.FilePutCode(Index : Longint; Code : TCode);
|
||||||
|
var
|
||||||
|
Dir, Path : string;
|
||||||
|
FileHandle : Integer;
|
||||||
|
begin
|
||||||
|
Dir := '';
|
||||||
|
GetDir(0, Dir);
|
||||||
|
Path := Dir + DirectorySeparator + CodeFile;
|
||||||
|
if not FileExists(Path) then
|
||||||
|
FileHandle := FileCreate(Path)
|
||||||
|
else
|
||||||
|
FileHandle := FileOpen(Path, fmOpenWrite);
|
||||||
|
FileSeek(FileHandle, Index * SizeOf(Code), 0);
|
||||||
|
FileWrite(FileHandle, Code, SizeOf(Code));
|
||||||
|
FileClose(FileHandle);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FillChar(SpecialCode, SizeOf(SpecialCode), 0);
|
||||||
|
if not FileGetCode(0, UsageCode) then
|
||||||
|
HexToBuffer(InitCode, UsageCode, SizeOf(UsageCode));
|
||||||
|
OgUsageCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{=================== Usage Code Stuff ==================}
|
||||||
|
|
||||||
|
procedure TForm1.OgUsageCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
begin
|
||||||
|
Key := TheKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.OgUsageCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
begin
|
||||||
|
Code := UsageCode;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.OgUsageCode1Checked(Sender: TObject; Status: TCodeStatus);
|
||||||
|
begin
|
||||||
|
{ If usage code is valid, app is still in demo period so enable only
|
||||||
|
default features }
|
||||||
|
if (Status = ogValidCode) then begin
|
||||||
|
OgUsageCode1.Decrease;
|
||||||
|
EnableFeatures(RequiredMask);
|
||||||
|
end else begin { Usage count has expired, go on to special code stuff }
|
||||||
|
FileGetCode(1, SpecialCode);
|
||||||
|
ModifyBtn.Enabled := True;
|
||||||
|
OgSpecialCode1.CheckCode(True);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.OgUsageCode1ChangeCode(Sender: TObject; Code: TCode);
|
||||||
|
var
|
||||||
|
FreebiesLeft : Longint;
|
||||||
|
begin
|
||||||
|
FreebiesLeft := OgUsageCode1.GetValue - 1;
|
||||||
|
UsageCode := Code;
|
||||||
|
FilePutCode(0, UsageCode);
|
||||||
|
Caption := DemoCaption + IntToStr(FreebiesLeft);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{================== Special Code Stuff =================}
|
||||||
|
|
||||||
|
procedure TForm1.OgSpecialCode1GetKey(Sender: TObject; var Key: TKey);
|
||||||
|
begin
|
||||||
|
Key := TheKey;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.OgSpecialCode1GetCode(Sender: TObject; var Code: TCode);
|
||||||
|
begin
|
||||||
|
Code := SpecialCode;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.OgSpecialCode1GetModifier(Sender: TObject;
|
||||||
|
var Value: Longint);
|
||||||
|
begin
|
||||||
|
Value := GenerateMachineModifierPrim;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.OgSpecialCode1Checked(Sender: TObject;
|
||||||
|
Status: TCodeStatus);
|
||||||
|
var
|
||||||
|
Features : Longint;
|
||||||
|
begin
|
||||||
|
{ If special code is valid, then app is registered so enable features }
|
||||||
|
if (Status = ogValidCode) then begin
|
||||||
|
FilePutCode(1, SpecialCode);
|
||||||
|
Features := OgSpecialCode1.GetValue;
|
||||||
|
EnableFeatures(Features);
|
||||||
|
Caption := RegisteredCap;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
{ Otherwise prompt for release code}
|
||||||
|
Features := DecodeSpecialCode;
|
||||||
|
if (Features <> 0) then begin
|
||||||
|
FilePutCode(1, SpecialCode);
|
||||||
|
EnableFeatures(Features);
|
||||||
|
Caption := RegisteredCap;
|
||||||
|
end else begin
|
||||||
|
EnableFeatures(0);
|
||||||
|
Caption := NotRegisteredCap;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{================== Registration Dialog ================}
|
||||||
|
|
||||||
|
function TForm1.DecodeSpecialCode : Longint;
|
||||||
|
var
|
||||||
|
CodeStr : string;
|
||||||
|
ModKey : TKey;
|
||||||
|
MachineID : string;
|
||||||
|
Modifier : longint;
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
MachineID := '';
|
||||||
|
Modifier := GenerateMachineModifierPrim;
|
||||||
|
MachineID := BufferToHex(Modifier, SizeOf(Modifier));
|
||||||
|
ModKey := TheKey;
|
||||||
|
ApplyModifierToKeyPrim(Modifier, ModKey, SizeOf(ModKey));
|
||||||
|
CodeStr := '';
|
||||||
|
if InputQuery('Machine ID: '+ MachineID ,
|
||||||
|
'Run EXSLCODE To Obtain Release Code', CodeStr) then begin
|
||||||
|
HexToBuffer(CodeStr, SpecialCode, SizeOf(SpecialCode));
|
||||||
|
if OgSpecialCode1.IsCodeValid then
|
||||||
|
Result := OgSpecialCode1.GetValue;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{================== The Rest of it ================}
|
||||||
|
|
||||||
|
procedure TForm1.EnableFeatures(Features : Longint);
|
||||||
|
begin
|
||||||
|
FeaturesRequired.Enabled := False;
|
||||||
|
FeaturesRequired.Checked := False;
|
||||||
|
FeaturesHelp.Enabled := False;
|
||||||
|
FeaturesHelp.Checked := False;
|
||||||
|
FeaturesExamples.Enabled := False;
|
||||||
|
FeaturesExamples.Checked := False;
|
||||||
|
FeaturesDatabase.Enabled := False;
|
||||||
|
FeaturesDatabase.Checked := False;
|
||||||
|
FeaturesFax.Enabled := False;
|
||||||
|
FeaturesFax.Checked := False;
|
||||||
|
FeaturesGoodies.Enabled := False;
|
||||||
|
FeaturesGoodies.Checked := False;
|
||||||
|
if (Features and RequiredMask) <> 0 then begin
|
||||||
|
FeaturesRequired.Enabled := True;
|
||||||
|
FeaturesRequired.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and HelpMask) <> 0 then begin
|
||||||
|
FeaturesHelp.Enabled := True;
|
||||||
|
FeaturesHelp.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and ExamplesMask) <> 0 then begin
|
||||||
|
FeaturesExamples.Enabled := True;
|
||||||
|
FeaturesExamples.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and DBMask) <> 0 then begin
|
||||||
|
FeaturesDatabase.Enabled := True;
|
||||||
|
FeaturesDatabase.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and FaxMask) <> 0 then begin
|
||||||
|
FeaturesFax.Enabled := True;
|
||||||
|
FeaturesFax.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features and GoodiesMask) <> 0 then begin
|
||||||
|
FeaturesGoodies.Enabled := True;
|
||||||
|
FeaturesGoodies.Checked := True;
|
||||||
|
end;
|
||||||
|
if (Features = 0) then
|
||||||
|
FeaturesMenu.Caption := 'No Features Enabled'
|
||||||
|
else
|
||||||
|
FeaturesMenu.Caption := '&Features';
|
||||||
|
end;
|
||||||
|
|
||||||
|
{-------------------------------------------------------}
|
||||||
|
|
||||||
|
procedure TForm1.ModifyBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Features : Longint;
|
||||||
|
begin
|
||||||
|
FillChar(SpecialCode, SizeOf(SpecialCode), 0);
|
||||||
|
Features := DecodeSpecialCode;
|
||||||
|
if (Features <> 0) then begin
|
||||||
|
FilePutCode(1, SpecialCode);
|
||||||
|
EnableFeatures(Features);
|
||||||
|
Caption := RegisteredCap;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exselec1.lrs}
|
||||||
|
|
||||||
|
end.
|
96
components/onguard/examples/exselect/exselect.lpi
Normal file
96
components/onguard/examples/exselect/exselect.lpi
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="3">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exselect.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="48" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exselec1.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exselec1.lrs"/>
|
||||||
|
<UnitName Value="Exselec1"/>
|
||||||
|
<CursorPos X="36" Y="313"/>
|
||||||
|
<TopLine Value="296"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="exselec1.lrs"/>
|
||||||
|
<CursorPos X="24" Y="5"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
</Unit2>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
15
components/onguard/examples/exselect/exselect.lpr
Normal file
15
components/onguard/examples/exselect/exselect.lpr
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
program Exselect;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
Exselec1 in 'EXSELEC1.PAS' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
112
components/onguard/examples/exslcode/exslcod1.lfm
Normal file
112
components/onguard/examples/exslcode/exslcod1.lfm
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
ActiveControl = MachineID
|
||||||
|
Caption = ' Special Code Generator '
|
||||||
|
ClientHeight = 243
|
||||||
|
ClientWidth = 288
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 13
|
||||||
|
HorzScrollBar.Page = 287
|
||||||
|
VertScrollBar.Page = 242
|
||||||
|
Left = 237
|
||||||
|
Height = 243
|
||||||
|
Top = 152
|
||||||
|
Width = 288
|
||||||
|
object Label1: TLabel
|
||||||
|
Caption = 'Machine ID'
|
||||||
|
Color = clNone
|
||||||
|
ParentColor = False
|
||||||
|
Left = 35
|
||||||
|
Height = 14
|
||||||
|
Top = 20
|
||||||
|
Width = 54
|
||||||
|
end
|
||||||
|
object GenBtn: TButton
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
|
Caption = 'Generate Code'
|
||||||
|
OnClick = GenBtnClick
|
||||||
|
TabOrder = 1
|
||||||
|
Left = 18
|
||||||
|
Height = 25
|
||||||
|
Top = 176
|
||||||
|
Width = 89
|
||||||
|
end
|
||||||
|
object MachineID: TEdit
|
||||||
|
MaxLength = 8
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 123
|
||||||
|
Height = 21
|
||||||
|
Top = 16
|
||||||
|
Width = 89
|
||||||
|
end
|
||||||
|
object GroupBox1: TGroupBox
|
||||||
|
Caption = 'Features'
|
||||||
|
ClientHeight = 79
|
||||||
|
ClientWidth = 221
|
||||||
|
TabOrder = 2
|
||||||
|
Left = 24
|
||||||
|
Height = 97
|
||||||
|
Top = 56
|
||||||
|
Width = 225
|
||||||
|
object ReqFeat: TCheckBox
|
||||||
|
Caption = 'Required'
|
||||||
|
Checked = True
|
||||||
|
Enabled = False
|
||||||
|
State = cbChecked
|
||||||
|
TabOrder = 0
|
||||||
|
Left = 16
|
||||||
|
Height = 17
|
||||||
|
Top = 24
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object HelpFeat: TCheckBox
|
||||||
|
Caption = 'Help'
|
||||||
|
TabOrder = 1
|
||||||
|
Left = 16
|
||||||
|
Height = 17
|
||||||
|
Top = 40
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object ExamplesFeat: TCheckBox
|
||||||
|
Caption = 'Examples'
|
||||||
|
TabOrder = 2
|
||||||
|
Left = 16
|
||||||
|
Height = 17
|
||||||
|
Top = 56
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object DBFeat: TCheckBox
|
||||||
|
Caption = 'Database'
|
||||||
|
TabOrder = 3
|
||||||
|
Left = 120
|
||||||
|
Height = 17
|
||||||
|
Top = 24
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object FaxFeat: TCheckBox
|
||||||
|
Caption = 'Fax'
|
||||||
|
TabOrder = 4
|
||||||
|
Left = 120
|
||||||
|
Height = 17
|
||||||
|
Top = 40
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object GoodiesFeat: TCheckBox
|
||||||
|
Caption = 'Goodies'
|
||||||
|
TabOrder = 5
|
||||||
|
Left = 120
|
||||||
|
Height = 17
|
||||||
|
Top = 56
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object CodeDisplay: TEdit
|
||||||
|
Color = clAqua
|
||||||
|
TabOrder = 3
|
||||||
|
Left = 123
|
||||||
|
Height = 21
|
||||||
|
Top = 178
|
||||||
|
Width = 126
|
||||||
|
end
|
||||||
|
end
|
30
components/onguard/examples/exslcode/exslcod1.lrs
Normal file
30
components/onguard/examples/exslcode/exslcod1.lrs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{ To jest automatycznie wygenerowany plik zasob�w lazarusa }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#13'ActiveControl'#7#9'MachineID'#7'Caption'#6#24' S'
|
||||||
|
+'pecial Code Generator '#12'ClientHeight'#3#243#0#11'ClientWidth'#3' '#1#11
|
||||||
|
+'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#13'PixelsPerInch'#2'`'
|
||||||
|
+#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3#31#1#18'VertScrollBar.Page'#3
|
||||||
|
+#242#0#4'Left'#3#237#0#6'Height'#3#243#0#3'Top'#3#152#0#5'Width'#3' '#1#0#6
|
||||||
|
+'TLabel'#6'Label1'#7'Caption'#6#10'Machine ID'#5'Color'#7#6'clNone'#11'Paren'
|
||||||
|
+'tColor'#8#4'Left'#2'#'#6'Height'#2#14#3'Top'#2#20#5'Width'#2'6'#0#0#7'TButt'
|
||||||
|
+'on'#6'GenBtn'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#13'Generate Co'
|
||||||
|
+'de'#7'OnClick'#7#11'GenBtnClick'#8'TabOrder'#2#1#4'Left'#2#18#6'Height'#2#25
|
||||||
|
+#3'Top'#3#176#0#5'Width'#2'Y'#0#0#5'TEdit'#9'MachineID'#9'MaxLength'#2#8#8'T'
|
||||||
|
+'abOrder'#2#0#4'Left'#2'{'#6'Height'#2#21#3'Top'#2#16#5'Width'#2'Y'#0#0#9'TG'
|
||||||
|
+'roupBox'#9'GroupBox1'#7'Caption'#6#8'Features'#12'ClientHeight'#2'O'#11'Cli'
|
||||||
|
+'entWidth'#3#221#0#8'TabOrder'#2#2#4'Left'#2#24#6'Height'#2'a'#3'Top'#2'8'#5
|
||||||
|
+'Width'#3#225#0#0#9'TCheckBox'#7'ReqFeat'#7'Caption'#6#8'Required'#7'Checked'
|
||||||
|
+#9#7'Enabled'#8#5'State'#7#9'cbChecked'#8'TabOrder'#2#0#4'Left'#2#16#6'Heigh'
|
||||||
|
+'t'#2#17#3'Top'#2#24#5'Width'#2'Q'#0#0#9'TCheckBox'#8'HelpFeat'#7'Caption'#6
|
||||||
|
+#4'Help'#8'TabOrder'#2#1#4'Left'#2#16#6'Height'#2#17#3'Top'#2'('#5'Width'#2
|
||||||
|
+'Q'#0#0#9'TCheckBox'#12'ExamplesFeat'#7'Caption'#6#8'Examples'#8'TabOrder'#2
|
||||||
|
+#2#4'Left'#2#16#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'Q'#0#0#9'TCheckBox'#6
|
||||||
|
+'DBFeat'#7'Caption'#6#8'Database'#8'TabOrder'#2#3#4'Left'#2'x'#6'Height'#2#17
|
||||||
|
+#3'Top'#2#24#5'Width'#2'Q'#0#0#9'TCheckBox'#7'FaxFeat'#7'Caption'#6#3'Fax'#8
|
||||||
|
+'TabOrder'#2#4#4'Left'#2'x'#6'Height'#2#17#3'Top'#2'('#5'Width'#2'Q'#0#0#9'T'
|
||||||
|
+'CheckBox'#11'GoodiesFeat'#7'Caption'#6#7'Goodies'#8'TabOrder'#2#5#4'Left'#2
|
||||||
|
+'x'#6'Height'#2#17#3'Top'#2'8'#5'Width'#2'Q'#0#0#0#5'TEdit'#11'CodeDisplay'#5
|
||||||
|
+'Color'#7#6'clAqua'#8'TabOrder'#2#3#4'Left'#2'{'#6'Height'#2#21#3'Top'#3#178
|
||||||
|
+#0#5'Width'#2'~'#0#0#0
|
||||||
|
]);
|
97
components/onguard/examples/exslcode/exslcod1.pas
Normal file
97
components/onguard/examples/exslcode/exslcod1.pas
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
{*********************************************************}
|
||||||
|
{* ONGUARD: EXSLCOD1.PAS *}
|
||||||
|
{* Copyright (c) TurboPower Software Co 1998 *}
|
||||||
|
{* All rights reserved. *}
|
||||||
|
{*********************************************************}
|
||||||
|
|
||||||
|
{ This example generates a special release code (via OnGuard API)
|
||||||
|
to enable various features of the companion examples, EXSELECT
|
||||||
|
and EXSELAPI. Enter the machine identifier displayed by those
|
||||||
|
examples and make the desired feature selection. The generic
|
||||||
|
key used by these examples will be modified by the value entered
|
||||||
|
for machine identifier to create the special release code with
|
||||||
|
a numeric value representing the features selected.}
|
||||||
|
|
||||||
|
unit Exslcod1;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes, Controls, Forms, Dialogs,Buttons,
|
||||||
|
OnGuard, OgUtil, StdCtrls,LResources{, Mask};
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Label1: TLabel;
|
||||||
|
GenBtn: TButton;
|
||||||
|
MachineID: TEdit;
|
||||||
|
GroupBox1: TGroupBox;
|
||||||
|
ReqFeat: TCheckBox;
|
||||||
|
HelpFeat: TCheckBox;
|
||||||
|
ExamplesFeat: TCheckBox;
|
||||||
|
DBFeat: TCheckBox;
|
||||||
|
FaxFeat: TCheckBox;
|
||||||
|
GoodiesFeat: TCheckBox;
|
||||||
|
CodeDisplay: TEdit;
|
||||||
|
procedure GenBtnClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
DemoKey: TKey = ($F1,$46,$8D,$E4,
|
||||||
|
$70,$AE,$92,$DC,
|
||||||
|
$13,$1A,$03,$C4,
|
||||||
|
$44,$25,$72,$F5);
|
||||||
|
|
||||||
|
RequiredMask: longint = $00000001;
|
||||||
|
HelpMask: longint = $00000002;
|
||||||
|
ExamplesMask: longint = $00000004;
|
||||||
|
DBMask: longint = $00000008;
|
||||||
|
FaxMask: longint = $00000010;
|
||||||
|
GoodiesMask: longint = $00000020;
|
||||||
|
|
||||||
|
procedure TForm1.GenBtnClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Key: TKey;
|
||||||
|
Modifier: Longint;
|
||||||
|
Code: TCode;
|
||||||
|
Expires: TDateTime;
|
||||||
|
Value: longint;
|
||||||
|
begin
|
||||||
|
Key := DemoKey;
|
||||||
|
HexToBuffer(MachineID.Text, Modifier, SizeOf(Modifier));
|
||||||
|
ApplyModifierToKeyPrim(Modifier, Key, SizeOf(Key));
|
||||||
|
Expires := Date + 5;
|
||||||
|
Value := RequiredMask;
|
||||||
|
If HelpFeat.Checked then
|
||||||
|
Value := Value + HelpMask;
|
||||||
|
If ExamplesFeat.Checked then
|
||||||
|
Value := Value + ExamplesMask;
|
||||||
|
If DBFeat.Checked then
|
||||||
|
Value := Value + DBMask;
|
||||||
|
If FaxFeat.Checked then
|
||||||
|
Value := Value + FaxMask;
|
||||||
|
If GoodiesFeat.Checked then
|
||||||
|
Value := Value + GoodiesMask;
|
||||||
|
InitSpecialCode(Key, Value, Expires, Code);
|
||||||
|
CodeDisplay.Text := BufferToHex(Code, SizeOf(Code));
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$i exslcod1.lrs}
|
||||||
|
|
||||||
|
end.
|
90
components/onguard/examples/exslcode/exslcode.lpi
Normal file
90
components/onguard/examples/exslcode/exslcode.lpi
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="/"/>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="2">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exslcode.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="48" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exslcod1.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exslcod1.lrs"/>
|
||||||
|
<UnitName Value="Exslcod1"/>
|
||||||
|
<CursorPos X="34" Y="68"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
15
components/onguard/examples/exslcode/exslcode.lpr
Normal file
15
components/onguard/examples/exslcode/exslcode.lpr
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
program Exslcode;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Interfaces,
|
||||||
|
Forms,
|
||||||
|
Exslcod1 in 'EXSLCOD1.PAS' {Form1}, tponguard;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
5
components/onguard/examples/exsnreg/ONGUARD.INI
Normal file
5
components/onguard/examples/exsnreg/ONGUARD.INI
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[Keys]
|
||||||
|
Flamenco=$E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4
|
||||||
|
|
||||||
|
[Codes]
|
||||||
|
SerialNumberCode=049CF7F37E44F6C6
|
92
components/onguard/examples/exsnreg/exsnreg.lpi
Normal file
92
components/onguard/examples/exsnreg/exsnreg.lpi
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Version Value="6"/>
|
||||||
|
<General>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value=".\"/>
|
||||||
|
<TargetFileExt Value=".exe"/>
|
||||||
|
<ActiveEditorIndexAtStart Value="0"/>
|
||||||
|
</General>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
|
||||||
|
<IgnoreBinaries Value="False"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
|
</local>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="1">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="tponguard"/>
|
||||||
|
<MinVersion Major="1" Valid="True"/>
|
||||||
|
</Item1>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units Count="2">
|
||||||
|
<Unit0>
|
||||||
|
<Filename Value="exsnreg.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<CursorPos X="48" Y="8"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="0"/>
|
||||||
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="exsnregu.pas"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceFilename Value="exsnregu.lrs"/>
|
||||||
|
<UnitName Value="Exsnregu"/>
|
||||||
|
<CursorPos X="31" Y="26"/>
|
||||||
|
<TopLine Value="1"/>
|
||||||
|
<EditorIndex Value="1"/>
|
||||||
|
<UsageCount Value="10"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
|
</Unit1>
|
||||||
|
</Units>
|
||||||
|
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="5"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Parsing>
|
||||||
|
<SyntaxOptions>
|
||||||
|
<IncludeAssertionCode Value="True"/>
|
||||||
|
</SyntaxOptions>
|
||||||
|
</Parsing>
|
||||||
|
<CodeGeneration>
|
||||||
|
<Checks>
|
||||||
|
<IOChecks Value="True"/>
|
||||||
|
<RangeChecks Value="True"/>
|
||||||
|
<OverflowChecks Value="True"/>
|
||||||
|
<StackChecks Value="True"/>
|
||||||
|
</Checks>
|
||||||
|
<Generate Value="Faster"/>
|
||||||
|
</CodeGeneration>
|
||||||
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<UseHeaptrc Value="True"/>
|
||||||
|
</Debugging>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="2">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item2>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user