├── Source ├── Icon.res ├── Resources │ ├── Icon.rc │ └── baseline_exposure_black_24dp.bmp ├── SE.IDE.Deputy.res ├── GetIt │ ├── white-48dp.zip │ ├── DeputyGetItIcon.png │ ├── DeputyGetItIcon - Copy.png │ ├── white-48dp │ │ ├── 1x │ │ │ └── outline_exposure_white_48dp.png │ │ └── 2x │ │ │ └── outline_exposure_white_48dp.png │ └── exposure_white_48dp.svg ├── SE.ProcMgrUtils.pas ├── SE.UpdateManager.pas ├── SE.IE.Deputy_2_4_2.pas ├── SERTTK.DeputyExpert.pas ├── SERTTK.DeputyTypes.pas ├── frmDeputyOptUpdates.dfm ├── frmDeputyOptInstanceManager.dfm ├── SE.IDE.Deputy.dpr ├── frmDeputyInstanceManager.dfm ├── frmDeputyOptionsInstance.dfm ├── frmDeputyOptUpdates.pas ├── frmDeputyInstanceManager.pas ├── frmDeputyOptInstanceManager.pas ├── frmDeputyOptionsInstance.pas ├── frmDeputyProcMgr.dfm ├── frmDeputyOptProcessManager.pas ├── frmDeputyOptProcessManager.dfm ├── frmDeputyUpdates.dfm ├── frmDeputyUpdates.pas └── frmDeputyProcMgr.pas ├── Release ├── SE.IDE.Deputy250.dll ├── SE.IDE.Deputy260.dll ├── SE.IDE.Deputy270.dll └── SE.IDE.Deputy280.dll ├── DevTools ├── IDEEmulator │ ├── idebds.dpr │ ├── frmIdeEmulator.dfm │ └── frmIdeEmulator.pas ├── DeputyFormHarness │ ├── DeputyFormHarness.dpr │ ├── frmDeputyFormHarness.pas │ └── frmDeputyFormHarness.dfm ├── LeakTests │ ├── ShowLeakMessage.dpr │ ├── frmShowMessageU.dfm │ ├── frmShowMessageU.pas │ └── ShowLeakMessage.dproj └── DeputyDevTools.groupproj ├── .gitignore ├── README.md └── LICENSE /Source/Icon.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/Icon.res -------------------------------------------------------------------------------- /Source/Resources/Icon.rc: -------------------------------------------------------------------------------- 1 | SplashScreenBitmap BITMAP "baseline_exposure_black_24dp.bmp" 2 | -------------------------------------------------------------------------------- /Source/SE.IDE.Deputy.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/SE.IDE.Deputy.res -------------------------------------------------------------------------------- /Source/GetIt/white-48dp.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/GetIt/white-48dp.zip -------------------------------------------------------------------------------- /Source/SE.ProcMgrUtils.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/SE.ProcMgrUtils.pas -------------------------------------------------------------------------------- /Source/SE.UpdateManager.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/SE.UpdateManager.pas -------------------------------------------------------------------------------- /Release/SE.IDE.Deputy250.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Release/SE.IDE.Deputy250.dll -------------------------------------------------------------------------------- /Release/SE.IDE.Deputy260.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Release/SE.IDE.Deputy260.dll -------------------------------------------------------------------------------- /Release/SE.IDE.Deputy270.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Release/SE.IDE.Deputy270.dll -------------------------------------------------------------------------------- /Release/SE.IDE.Deputy280.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Release/SE.IDE.Deputy280.dll -------------------------------------------------------------------------------- /Source/SE.IE.Deputy_2_4_2.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/SE.IE.Deputy_2_4_2.pas -------------------------------------------------------------------------------- /Source/SERTTK.DeputyExpert.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/SERTTK.DeputyExpert.pas -------------------------------------------------------------------------------- /Source/SERTTK.DeputyTypes.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/SERTTK.DeputyTypes.pas -------------------------------------------------------------------------------- /Source/GetIt/DeputyGetItIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/GetIt/DeputyGetItIcon.png -------------------------------------------------------------------------------- /Source/GetIt/DeputyGetItIcon - Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/GetIt/DeputyGetItIcon - Copy.png -------------------------------------------------------------------------------- /Source/Resources/baseline_exposure_black_24dp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/Resources/baseline_exposure_black_24dp.bmp -------------------------------------------------------------------------------- /Source/GetIt/white-48dp/1x/outline_exposure_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/GetIt/white-48dp/1x/outline_exposure_white_48dp.png -------------------------------------------------------------------------------- /Source/GetIt/white-48dp/2x/outline_exposure_white_48dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SwiftExpat/Deputy/HEAD/Source/GetIt/white-48dp/2x/outline_exposure_white_48dp.png -------------------------------------------------------------------------------- /DevTools/IDEEmulator/idebds.dpr: -------------------------------------------------------------------------------- 1 | program idebds; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmIdeEmulator in 'frmIdeEmulator.pas' {frmIdeEmulate}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TfrmIdeEmulate, frmIdeEmulate); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Source/GetIt/exposure_white_48dp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DevTools/DeputyFormHarness/DeputyFormHarness.dpr: -------------------------------------------------------------------------------- 1 | program DeputyFormHarness; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmDeputyFormHarness in 'frmDeputyFormHarness.pas' {frmDeputyHarness}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TfrmDeputyHarness, frmDeputyHarness); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /DevTools/LeakTests/ShowLeakMessage.dpr: -------------------------------------------------------------------------------- 1 | program ShowLeakMessage; 2 | 3 | uses 4 | Vcl.Forms, 5 | frmShowMessageU in 'frmShowMessageU.pas' {LeakLoopTester}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | ReportMemoryLeaksonShutdown := true; 11 | Application.Initialize; 12 | Application.MainFormOnTaskbar := True; 13 | Application.CreateForm(TLeakLoopTester, LeakLoopTester); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /Source/frmDeputyOptUpdates.dfm: -------------------------------------------------------------------------------- 1 | object frmDeputyOptUpdate: TfrmDeputyOptUpdate 2 | Left = 0 3 | Top = 0 4 | Width = 640 5 | Height = 480 6 | TabOrder = 0 7 | object LinkLabel1: TLinkLabel 8 | AlignWithMargins = True 9 | Left = 3 10 | Top = 3 11 | Width = 634 12 | Height = 29 13 | Align = alTop 14 | Caption = 'Update options for Deputy' 15 | TabOrder = 0 16 | ExplicitLeft = 0 17 | ExplicitTop = 0 18 | ExplicitWidth = 219 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /Source/frmDeputyOptInstanceManager.dfm: -------------------------------------------------------------------------------- 1 | object frmDeputyOptInstMgr: TfrmDeputyOptInstMgr 2 | Left = 0 3 | Top = 0 4 | Width = 640 5 | Height = 480 6 | Align = alClient 7 | TabOrder = 0 8 | object lblDeputyInstMgrHeader: TLabel 9 | AlignWithMargins = True 10 | Left = 3 11 | Top = 3 12 | Width = 634 13 | Height = 25 14 | Align = alTop 15 | Caption = 16 | 'Control Deputy'#39's ability to detect a second instance of the IDE ' + 17 | 'at startup.' 18 | WordWrap = True 19 | ExplicitWidth = 576 20 | end 21 | object rgInstanceManager: TRadioGroup 22 | Left = 0 23 | Top = 31 24 | Width = 640 25 | Height = 105 26 | Hint = 'Disable prevents the Instance Manager in the IDE started event' 27 | Align = alTop 28 | Caption = 'Instance Manager' 29 | Items.Strings = ( 30 | 'Disable' 31 | 'Enable') 32 | TabOrder = 0 33 | OnClick = rgInstanceManagerClick 34 | ExplicitTop = 56 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /Source/SE.IDE.Deputy.dpr: -------------------------------------------------------------------------------- 1 | library SE.IDE.Deputy; 2 | 3 | {$R 'Icon.res' 'Resources\Icon.rc'} 4 | {$I DW.LibSuffixIDE.inc} 5 | 6 | uses 7 | System.SysUtils, 8 | System.Classes, 9 | SERTTK.DeputyTypes in 'SERTTK.DeputyTypes.pas', 10 | SERTTK.DeputyExpert in 'SERTTK.DeputyExpert.pas', 11 | frmDeputyProcMgr in 'frmDeputyProcMgr.pas' {DeputyProcMgr}, 12 | frmDeputyUpdates in 'frmDeputyUpdates.pas' {DeputyUpdates}, 13 | SE.UpdateManager in 'SE.UpdateManager.pas', 14 | SE.ProcMgrUtils in 'SE.ProcMgrUtils.pas', 15 | frmDeputyInstanceManager in 'frmDeputyInstanceManager.pas' {DeputyInstanceManager}, 16 | frmDeputyOptionsInstance in 'frmDeputyOptionsInstance.pas' {frmDeputyOptInstance: TFrame}, 17 | frmDeputyOptInstanceManager in 'frmDeputyOptInstanceManager.pas' {frmDeputyOptInstMgr: TFrame}, 18 | frmDeputyOptUpdates in 'frmDeputyOptUpdates.pas' {frmDeputyOptUpdate: TFrame}, 19 | frmDeputyOptProcessManager in 'frmDeputyOptProcessManager.pas' {frmDeputyOptProcMgr: TFrame}; 20 | 21 | {$R *.res} 22 | 23 | begin 24 | 25 | end. 26 | -------------------------------------------------------------------------------- /DevTools/IDEEmulator/frmIdeEmulator.dfm: -------------------------------------------------------------------------------- 1 | object frmIdeEmulate: TfrmIdeEmulate 2 | Left = 0 3 | Top = 0 4 | Caption = 'Ide Emulator' 5 | ClientHeight = 454 6 | ClientWidth = 788 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | OnCreate = FormCreate 14 | TextHeight = 15 15 | object Memo1: TMemo 16 | Left = 0 17 | Top = 199 18 | Width = 788 19 | Height = 255 20 | Align = alBottom 21 | Lines.Strings = ( 22 | 'Memo1') 23 | TabOrder = 0 24 | ExplicitTop = 216 25 | ExplicitWidth = 794 26 | end 27 | object btnCheckRunning: TButton 28 | Left = 136 29 | Top = 64 30 | Width = 153 31 | Height = 25 32 | Caption = 'Check Running' 33 | TabOrder = 1 34 | OnClick = btnCheckRunningClick 35 | end 36 | object btnInstanceManager: TButton 37 | Left = 392 38 | Top = 64 39 | Width = 209 40 | Height = 25 41 | Caption = 'Instance manager' 42 | TabOrder = 2 43 | OnClick = btnInstanceManagerClick 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /DevTools/LeakTests/frmShowMessageU.dfm: -------------------------------------------------------------------------------- 1 | object LeakLoopTester: TLeakLoopTester 2 | Left = 0 3 | Top = 0 4 | Caption = 'Leak and Loop Tester' 5 | ClientHeight = 424 6 | ClientWidth = 618 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | TextHeight = 15 14 | object Button1: TButton 15 | Left = 176 16 | Top = 56 17 | Width = 75 18 | Height = 25 19 | Caption = 'Single leak' 20 | TabOrder = 0 21 | OnClick = Button1Click 22 | end 23 | object Button2: TButton 24 | Left = 48 25 | Top = 56 26 | Width = 75 27 | Height = 25 28 | Caption = 'big leak' 29 | TabOrder = 1 30 | OnClick = Button2Click 31 | end 32 | object btnLoop: TButton 33 | Left = 48 34 | Top = 144 35 | Width = 121 36 | Height = 25 37 | Caption = 'Loop forever' 38 | TabOrder = 2 39 | OnClick = btnLoopClick 40 | end 41 | object Memo1: TMemo 42 | Left = 0 43 | Top = 335 44 | Width = 618 45 | Height = 89 46 | Align = alBottom 47 | Lines.Strings = ( 48 | 'Memo1') 49 | TabOrder = 3 50 | end 51 | object memTable: TFDMemTable 52 | FetchOptions.AssignedValues = [evMode] 53 | FetchOptions.Mode = fmAll 54 | ResourceOptions.AssignedValues = [rvSilentMode] 55 | ResourceOptions.SilentMode = True 56 | UpdateOptions.AssignedValues = [uvCheckRequired, uvAutoCommitUpdates] 57 | UpdateOptions.CheckRequired = False 58 | UpdateOptions.AutoCommitUpdates = True 59 | Left = 504 60 | Top = 144 61 | object memTableLeakName: TStringField 62 | FieldName = 'LeakName' 63 | end 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | *.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | #*.dll 32 | *.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | 60 | # Delphi history and backups 61 | __history/ 62 | __recovery/ 63 | win32/ 64 | *.~* 65 | 66 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 67 | *.stat 68 | 69 | # Boss dependency manager vendor folder https://github.com/HashLoad/boss 70 | modules/ 71 | Source/SE.IDE.Deputy.delphilsp.json 72 | *.delphilsp.json 73 | GRTAGS 74 | GPATH 75 | GTAGS 76 | *.gex 77 | -------------------------------------------------------------------------------- /Source/frmDeputyInstanceManager.dfm: -------------------------------------------------------------------------------- 1 | object DeputyInstanceManager: TDeputyInstanceManager 2 | Left = 0 3 | Top = 0 4 | Caption = 'Deputy Instance Manager' 5 | ClientHeight = 424 6 | ClientWidth = 618 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | Position = poMainFormCenter 14 | OnCreate = FormCreate 15 | OnDestroy = FormDestroy 16 | TextHeight = 15 17 | object Label1: TLabel 18 | Left = 0 19 | Top = 0 20 | Width = 618 21 | Height = 65 22 | Align = alTop 23 | Alignment = taCenter 24 | Caption = '!! 2 Delphi IDE instances !!' 25 | Font.Charset = DEFAULT_CHARSET 26 | Font.Color = 3937500 27 | Font.Height = -48 28 | Font.Name = 'Segoe UI' 29 | Font.Style = [] 30 | ParentFont = False 31 | ExplicitWidth = 549 32 | end 33 | object btnCloseOriginal: TButton 34 | Left = 96 35 | Top = 152 36 | Width = 281 37 | Height = 41 38 | Caption = 'Close Original Instance' 39 | Font.Charset = DEFAULT_CHARSET 40 | Font.Color = clWindowText 41 | Font.Height = -24 42 | Font.Name = 'Segoe UI' 43 | Font.Style = [] 44 | ParentFont = False 45 | TabOrder = 1 46 | OnClick = btnCloseOriginalClick 47 | end 48 | object btnCloseInstance: TButton 49 | Left = 96 50 | Top = 88 51 | Width = 281 52 | Height = 41 53 | Caption = 'Close This Instance' 54 | Font.Charset = DEFAULT_CHARSET 55 | Font.Color = clWindowText 56 | Font.Height = -24 57 | Font.Name = 'Segoe UI' 58 | Font.Style = [] 59 | ParentFont = False 60 | TabOrder = 0 61 | OnClick = btnCloseInstanceClick 62 | end 63 | object btnHideMessage: TButton 64 | Left = 96 65 | Top = 216 66 | Width = 281 67 | Height = 41 68 | Caption = 'Ignore Instance' 69 | Font.Charset = DEFAULT_CHARSET 70 | Font.Color = clWindowText 71 | Font.Height = -24 72 | Font.Name = 'Segoe UI' 73 | Font.Style = [] 74 | ParentFont = False 75 | TabOrder = 2 76 | OnClick = btnHideMessageClick 77 | end 78 | object memoLog: TMemo 79 | Left = 0 80 | Top = 280 81 | Width = 618 82 | Height = 144 83 | Align = alBottom 84 | ScrollBars = ssBoth 85 | TabOrder = 3 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /Source/frmDeputyOptionsInstance.dfm: -------------------------------------------------------------------------------- 1 | object frmDeputyOptInstance: TfrmDeputyOptInstance 2 | Left = 0 3 | Top = 0 4 | Width = 640 5 | Height = 480 6 | Align = alClient 7 | TabOrder = 0 8 | object lblHeader: TLabel 9 | AlignWithMargins = True 10 | Left = 3 11 | Top = 3 12 | Width = 634 13 | Height = 25 14 | Align = alTop 15 | Caption = 'Use the options to configure functionality of Deputy' 16 | ExplicitWidth = 414 17 | end 18 | object gpInstOptions: TGridPanel 19 | Left = 0 20 | Top = 31 21 | Width = 640 22 | Height = 449 23 | Align = alClient 24 | Caption = 'gpInstOptions' 25 | ColumnCollection = < 26 | item 27 | Value = 100.000000000000000000 28 | end> 29 | ControlCollection = < 30 | item 31 | Column = 0 32 | Control = llDocumentation 33 | Row = 0 34 | end 35 | item 36 | Column = 0 37 | Control = pnlOpenSource 38 | Row = 1 39 | end> 40 | RowCollection = < 41 | item 42 | Value = 50.000000000000000000 43 | end 44 | item 45 | Value = 50.000000000000000000 46 | end> 47 | ShowCaption = False 48 | TabOrder = 0 49 | object llDocumentation: TLinkLabel 50 | Left = 1 51 | Top = 1 52 | Width = 638 53 | Height = 29 54 | Align = alTop 55 | Caption = 56 | 'Documentation Deputy Home' + 57 | 'page .' 58 | TabOrder = 0 59 | ExplicitWidth = 293 60 | end 61 | object pnlOpenSource: TPanel 62 | Left = 1 63 | Top = 225 64 | Width = 638 65 | Height = 223 66 | Align = alClient 67 | Caption = 'pnlOpenSource' 68 | ShowCaption = False 69 | TabOrder = 1 70 | object llOpenSourceAcknowledge: TLinkLabel 71 | AlignWithMargins = True 72 | Left = 4 73 | Top = 4 74 | Width = 630 75 | Height = 29 76 | Align = alTop 77 | Caption = 78 | 'Deputy uses TOTA' + 79 | 'L, a framework for experts, and Kastri .' 81 | TabOrder = 0 82 | ExplicitWidth = 450 83 | end 84 | object llOpenSourceCommit: TLinkLabel 85 | Left = 1 86 | Top = 36 87 | Width = 636 88 | Height = 29 89 | Align = alTop 90 | Caption = 'llOpenSourceCommit' 91 | TabOrder = 1 92 | ExplicitWidth = 174 93 | end 94 | end 95 | end 96 | end 97 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Top language](https://img.shields.io/github/languages/top/SwiftExpat/Deputy) 2 | [![GitHub release](https://img.shields.io/github/release/SwiftExpat/Deputy)](https://github.com/SwiftExpat/Deputy/releases) 3 | [![GitHub issues](https://img.shields.io/github/issues/SwiftExpat/Deputy)](https://github.com/SwiftExpat/Deputy/issues) 4 | [![GitHub PR](https://img.shields.io/github/issues-pr/SwiftExpat/Deputy)](https://github.com/SwiftExpat/Deputy/pulls) 5 | ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/SwiftExpat/Deputy) 6 | ![GitHub last commit](https://img.shields.io/github/last-commit/SwiftExpat/Deputy) 7 | 8 | # Deputy 9 | 10 | Delphi IDE expert providing integration of RunTime ToolKit, more information can be found here, https://swiftexpat.com/deputy.html. 11 | Deputy was created using TOTAL https://github.com/DelphiWorlds/TOTAL 12 | 13 | ## License 14 | 15 | Deputy is dual-licensed. Options are: 16 | 1. Choose to use it under the restrictions of the GPL v3 licence at no cost to you. 17 | 2. Purchase a commercial license with support for 1 year at https://swiftexpat.com/deputy.html. 18 | 19 | ## Install Expert 20 | 21 | [Install / Uninstall instructions](https://github.com/SwiftExpat/Deputy/wiki/Deputy-Install---UnInstall) 22 | 23 | ## Process Manager 24 | 25 | Process Manager will montior compile and debug actions in the Delphi IDE and terminate any running instances of the target application before compile. Options are to terminate the process without saving any data or close and handle the memory leak. 26 | 27 | > Series 2.6 Release details 28 | 29 | [![Release 2.6 Process Manager](https://img.youtube.com/vi/j7EdJcQSELY/hqdefault.jpg)](https://youtu.be/j7EdJcQSELY) 30 | 31 | ### Process Identification Logic 32 | 33 | The plugin identifies process to kill in the following order: 34 | 35 | 1. Process that is a child of the IDE instance by PID and process name 36 | 2. Process by image path to ensure process killed is the one that would be overwritten by the IDE ( this allows you to have another copy running from a second directory ie your release build) 37 | 38 | ### Purpose 39 | 40 | The IDE does not check before running a compile, it runs a few seconds of precompile then prompts that it can not overwrite the target. This expert watches before that compile starts and clears out the old process to save me some seconds. 41 | 42 | ## Instance Manager 43 | 44 | Instance Manager prevents multiple versions of the Delphi IDE from running at the same time. 45 | 46 | > Series 2.6 Release details 47 | 48 | [![Release 2.6 Instance Manager](https://img.youtube.com/vi/xIgnnfIDA2k/hqdefault.jpg)](https://youtu.be/xIgnnfIDA2k) 49 | 50 | ![Powered By Delphi](https://i1.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/01/Powered-by-Delphi-white-175px-7388078.png?resize=175%2C82&ssl=1) [Powered by Delphi](https://www.embarcadero.com/products/delphi) 51 | -------------------------------------------------------------------------------- /DevTools/LeakTests/frmShowMessageU.pas: -------------------------------------------------------------------------------- 1 | unit frmShowMessageU; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Generics.Collections, FireDAC.Stan.Intf, FireDAC.Stan.Option, 8 | FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, Data.DB, 9 | FireDAC.Comp.DataSet, FireDAC.Comp.Client; 10 | 11 | type 12 | 13 | TLeakChild = class 14 | strict private 15 | FLeakDict: TDictionary; 16 | public 17 | constructor Create; 18 | end; 19 | 20 | TLeakParent = class 21 | strict private 22 | FLeakChild: TLeakChild; 23 | FLeakList: TObjectList; 24 | public 25 | constructor Create; 26 | end; 27 | 28 | TLeaker = class 29 | leakstring: string; 30 | end; 31 | 32 | TLeakLoopTester = class(TForm) 33 | Button1: TButton; 34 | Button2: TButton; 35 | btnLoop: TButton; 36 | memTable: TFDMemTable; 37 | memTableLeakName: TStringField; 38 | Memo1: TMemo; 39 | procedure Button1Click(Sender: TObject); 40 | procedure Button2Click(Sender: TObject); 41 | procedure btnLoopClick(Sender: TObject); 42 | private 43 | { Private declarations } 44 | FLeakRoot: TLeakParent; 45 | public 46 | { Public declarations } 47 | end; 48 | 49 | var 50 | LeakLoopTester: TLeakLoopTester; 51 | 52 | implementation 53 | 54 | {$R *.dfm} 55 | 56 | procedure TLeakLoopTester.btnLoopClick(Sender: TObject); 57 | var 58 | l: TLeaker; 59 | begin 60 | memTable.Open; 61 | memTable.Append; 62 | memTable.FieldbyName('LeakName').AsString := 'leaky'; 63 | memTable.Post; 64 | memTable.First; 65 | while not memTable.Eof do 66 | begin 67 | l := TLeaker.Create; 68 | l.leakstring := memTable.FieldbyName('LeakName').AsString; 69 | Memo1.Lines.Add(l.leakstring); 70 | //memTable.Next; 71 | end; 72 | end; 73 | 74 | procedure TLeakLoopTester.Button1Click(Sender: TObject); 75 | var 76 | lk: TLeaker; 77 | begin 78 | lk := TLeaker.Create; 79 | lk.leakstring := 'long string'; 80 | //ShowMessage('This is a body message'); 81 | end; 82 | 83 | procedure TLeakLoopTester.Button2Click(Sender: TObject); 84 | begin 85 | FLeakRoot := TLeakParent.Create 86 | end; 87 | { TLeakParent } 88 | 89 | constructor TLeakParent.Create; 90 | var 91 | i: integer; 92 | begin 93 | FLeakChild := TLeakChild.Create; 94 | FLeakList := TObjectList.Create; 95 | for i := 0 to 1000 do 96 | FLeakList.Add(TLeakChild.Create); 97 | end; 98 | 99 | { TLeakChild } 100 | 101 | constructor TLeakChild.Create; 102 | const 103 | pfx_key = 'Key'; 104 | pfx_val = 'Val'; 105 | var 106 | i: integer; 107 | begin 108 | FLeakDict := TDictionary.Create; 109 | for i := 0 to 5000 do 110 | FLeakDict.Add(pfx_key + i.ToString, pfx_val + i.ToString) 111 | 112 | end; 113 | 114 | end. 115 | -------------------------------------------------------------------------------- /DevTools/IDEEmulator/frmIdeEmulator.pas: -------------------------------------------------------------------------------- 1 | unit frmIdeEmulator; 2 | 3 | {$WARN SYMBOL_PLATFORM OFF} 4 | 5 | interface 6 | 7 | uses 8 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 9 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; 10 | 11 | type 12 | TfrmIdeEmulate = class(TForm) 13 | Memo1: TMemo; 14 | btnCheckRunning: TButton; 15 | btnInstanceManager: TButton; 16 | procedure FormCreate(Sender: TObject); 17 | procedure btnCheckRunningClick(Sender: TObject); 18 | procedure btnInstanceManagerClick(Sender: TObject); 19 | private 20 | FExeName: string; 21 | FBDSID: cardinal; 22 | function CheckIdeRunning: boolean; 23 | procedure LogMsg(AMessage: string); 24 | function ExeName(ACmdLine: string): string; 25 | public 26 | { Public declarations } 27 | end; 28 | 29 | var 30 | frmIdeEmulate: TfrmIdeEmulate; 31 | 32 | implementation 33 | 34 | {$R *.dfm} 35 | 36 | uses SE.ProcMgrUtils, frmDeputyInstanceManager; 37 | 38 | procedure TfrmIdeEmulate.btnCheckRunningClick(Sender: TObject); 39 | begin 40 | if CheckIdeRunning then 41 | LogMsg('IDE running'); 42 | end; 43 | 44 | procedure TfrmIdeEmulate.btnInstanceManagerClick(Sender: TObject); 45 | var 46 | im : TDeputyInstanceManager; 47 | begin 48 | im := TDeputyInstanceManager.Create(self); 49 | im.CheckSecondInstance; 50 | end; 51 | 52 | function TfrmIdeEmulate.CheckIdeRunning: boolean; 53 | var 54 | procMgr: TSEProcessManager; 55 | fn, dn: string; 56 | procInfo, dupInfo: TSEProcessInfo; 57 | 58 | begin 59 | procMgr := TSEProcessManager.Create; 60 | procInfo := TSEProcessInfo.Create; 61 | dupInfo := TSEProcessInfo.Create; 62 | try 63 | procMgr.OnMessage := LogMsg; 64 | FExeName := ExeName(cmdLine); 65 | LogMsg('Parsed ExeName = ' + FExeName); 66 | result := procMgr.ProcFileExists(FExeName, fn, dn); 67 | if result then 68 | LogMsg('IDE Found'); 69 | 70 | procInfo.ProcID := FBDSID; 71 | result := procMgr.procInfo(procInfo); 72 | if result then 73 | begin 74 | LogMsg('ProcID = ' + procInfo.ProcID.ToString); 75 | LogMsg('ParentID = ' + procInfo.ParentProcID.ToString); 76 | LogMsg('ProcPath = ' + procInfo.ImagePath); 77 | LogMsg('Command Line' + procInfo.CommandLine); 78 | if procMgr.ProcessIsSecondInstance(procInfo, dupInfo) then 79 | begin 80 | LogMsg('Second instance'); 81 | end 82 | else 83 | LogMsg('First instance'); 84 | end 85 | else 86 | LogMsg('Proc Not found'); 87 | finally 88 | procInfo.Free; 89 | procMgr.Free; 90 | end; 91 | 92 | end; 93 | 94 | /// 95 | /// Parses exe name from Cmdline sys 96 | /// 97 | /// 98 | /// "C:\Repos\Github\Deputy\DevTools\IDEEmulator\Win32\Debug\idebds.exe" -r keyname -user username -pass pwd 99 | /// 100 | function TfrmIdeEmulate.ExeName(ACmdLine: string): string; 101 | var 102 | q1: integer; 103 | begin 104 | q1 := ACmdLine.IndexOf('"'); 105 | result := ACmdLine.Substring((q1 + 1), ACmdLine.IndexOf('"', (q1 + 1)) - 1); 106 | end; 107 | 108 | procedure TfrmIdeEmulate.FormCreate(Sender: TObject); 109 | var 110 | I: integer; 111 | begin 112 | Memo1.Lines.Clear; 113 | LogMsg('started with cmdLine: ' + cmdLine); 114 | for I := 1 to ParamCount do 115 | LogMsg(ParamStr(I)); 116 | FBDSID := GetCurrentProcessID; 117 | LogMsg('Procid = ' + FBDSID.ToString); 118 | end; 119 | 120 | procedure TfrmIdeEmulate.LogMsg(AMessage: string); 121 | begin 122 | Memo1.Lines.Add(AMessage); 123 | end; 124 | 125 | end. 126 | -------------------------------------------------------------------------------- /Source/frmDeputyOptUpdates.pas: -------------------------------------------------------------------------------- 1 | unit frmDeputyOptUpdates; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, 7 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, ToolsAPI, SERTTK.DeputyTypes, Vcl.Dialogs, Vcl.ExtCtrls; 8 | 9 | const 10 | caption_opt_label_updates = 'Deputy.Updates'; 11 | MAJ_VER = 1; // Major version nr. 12 | MIN_VER = 0; // Minor version nr. 13 | REL_VER = 0; // Release nr. 14 | BLD_VER = 0; // Build nr. 15 | 16 | // Version history 17 | // v1.0.0.0 : First Release 18 | 19 | { ******************************************************************** } 20 | { written by swiftexpat } 21 | { copyright 2022 } 22 | { Email : support@swiftexpat.com } 23 | { Web : https://swiftexpat.com } 24 | { } 25 | { The source code is given as is. The author is not responsible } 26 | { for any possible damage done due to the use of this code. } 27 | { The complete source code remains property of the author and may } 28 | { not be distributed, published, given or sold in any form as such. } 29 | { No parts of the source code can be included in any other component } 30 | { or application without written authorization of the author. } 31 | { ******************************************************************** } 32 | 33 | type 34 | TfrmDeputyOptUpdate = class(TFrame) 35 | LinkLabel1: TLinkLabel; 36 | strict private 37 | FSettings: TSERTTKDeputySettings; 38 | public 39 | property DeputySettings: TSERTTKDeputySettings read FSettings write FSettings; 40 | procedure InitializeFrame; 41 | procedure FinalizeFrame; 42 | end; 43 | 44 | TSERTTKDeputyIDEOptUpdates = Class(TInterfacedObject, INTAAddInOptions) 45 | Strict Private 46 | FFrame: TfrmDeputyOptUpdate; 47 | FSettings: TSERTTKDeputySettings; 48 | Public 49 | property DeputySettings: TSERTTKDeputySettings read FSettings write FSettings; 50 | Procedure DialogClosed(Accepted: Boolean); 51 | Procedure FrameCreated(AFrame: TCustomFrame); 52 | Function GetArea: String; 53 | Function GetCaption: String; 54 | Function GetFrameClass: TCustomFrameClass; 55 | Function GetHelpContext: Integer; 56 | Function IncludeInIDEInsight: Boolean; 57 | Function ValidateContents: Boolean; 58 | End; 59 | 60 | implementation 61 | 62 | {$R *.dfm} 63 | { TfrmDeputyOptUpdate } 64 | 65 | procedure TfrmDeputyOptUpdate.FinalizeFrame; 66 | begin 67 | 68 | end; 69 | 70 | procedure TfrmDeputyOptUpdate.InitializeFrame; 71 | begin 72 | 73 | end; 74 | 75 | { TSERTTKDeputyIDEOptUpdates } 76 | 77 | procedure TSERTTKDeputyIDEOptUpdates.DialogClosed(Accepted: Boolean); 78 | begin 79 | if Accepted then 80 | FFrame.FinalizeFrame; 81 | end; 82 | 83 | procedure TSERTTKDeputyIDEOptUpdates.FrameCreated(AFrame: TCustomFrame); 84 | begin 85 | If AFrame Is TfrmDeputyOptUpdate Then 86 | Begin 87 | FFrame := AFrame As TfrmDeputyOptUpdate; 88 | FFrame.DeputySettings := DeputySettings; 89 | FFrame.InitializeFrame; 90 | End; 91 | end; 92 | 93 | function TSERTTKDeputyIDEOptUpdates.GetArea: String; 94 | begin 95 | result := ''; 96 | end; 97 | 98 | function TSERTTKDeputyIDEOptUpdates.GetCaption: String; 99 | begin 100 | result := caption_opt_label_updates; 101 | end; 102 | 103 | function TSERTTKDeputyIDEOptUpdates.GetFrameClass: TCustomFrameClass; 104 | begin 105 | result := TfrmDeputyOptUpdate; 106 | end; 107 | 108 | function TSERTTKDeputyIDEOptUpdates.GetHelpContext: Integer; 109 | begin 110 | result := 0; 111 | end; 112 | 113 | function TSERTTKDeputyIDEOptUpdates.IncludeInIDEInsight: Boolean; 114 | begin 115 | result := true; 116 | end; 117 | 118 | function TSERTTKDeputyIDEOptUpdates.ValidateContents: Boolean; 119 | begin 120 | result := true; 121 | end; 122 | 123 | end. 124 | -------------------------------------------------------------------------------- /DevTools/DeputyDevTools.groupproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {A47B5A95-9443-43F7-90FF-070FE5C6EF14} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Default.Personality.12 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /Source/frmDeputyInstanceManager.pas: -------------------------------------------------------------------------------- 1 | unit frmDeputyInstanceManager; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, SE.ProcMgrUtils; 8 | 9 | const 10 | MAJ_VER = 1; // Major version nr. 11 | MIN_VER = 0; // Minor version nr. 12 | REL_VER = 0; // Release nr. 13 | BLD_VER = 0; // Build nr. 14 | 15 | // Version history 16 | // v1.0.0.0 : First Release 17 | 18 | { ******************************************************************** } 19 | { written by swiftexpat } 20 | { copyright 2022 } 21 | { Email : support@swiftexpat.com } 22 | { Web : https://swiftexpat.com } 23 | { } 24 | { The source code is given as is. The author is not responsible } 25 | { for any possible damage done due to the use of this code. } 26 | { The complete source code remains property of the author and may } 27 | { not be distributed, published, given or sold in any form as such. } 28 | { No parts of the source code can be included in any other component } 29 | { or application without written authorization of the author. } 30 | { ******************************************************************** } 31 | 32 | type 33 | TDeputyInstanceManager = class(TForm) 34 | Label1: TLabel; 35 | btnCloseOriginal: TButton; 36 | btnCloseInstance: TButton; 37 | btnHideMessage: TButton; 38 | memoLog: TMemo; 39 | procedure btnHideMessageClick(Sender: TObject); 40 | procedure FormCreate(Sender: TObject); 41 | procedure FormDestroy(Sender: TObject); 42 | procedure btnCloseInstanceClick(Sender: TObject); 43 | procedure btnCloseOriginalClick(Sender: TObject); 44 | strict private 45 | FProcInfo, FDupInfo: TSEProcessInfo; 46 | FProcMgr: TSEProcessManager; 47 | private 48 | procedure LogMsg(AMessage: string); 49 | procedure LogInfo; 50 | public 51 | procedure CheckSecondInstance; 52 | end; 53 | 54 | var 55 | DeputyInstanceManager: TDeputyInstanceManager; 56 | 57 | implementation 58 | 59 | {$R *.dfm} 60 | 61 | procedure TDeputyInstanceManager.btnCloseInstanceClick(Sender: TObject); 62 | begin 63 | Application.Terminate; // gracefully exit this instance of the IDE 64 | end; 65 | 66 | procedure TDeputyInstanceManager.btnCloseOriginalClick(Sender: TObject); 67 | begin 68 | LogMsg('Terminating proc id :' + FDupInfo.ProcID.ToString); 69 | FProcMgr.TerminateProcessByID(FDupInfo.ProcID); 70 | end; 71 | 72 | procedure TDeputyInstanceManager.btnHideMessageClick(Sender: TObject); 73 | begin 74 | self.Hide; 75 | end; 76 | 77 | procedure TDeputyInstanceManager.CheckSecondInstance; 78 | begin 79 | try 80 | FProcInfo.ProcID := GetCurrentProcessID; 81 | if FProcMgr.ProcInfo(FProcInfo) then 82 | begin 83 | LogInfo; 84 | if FProcMgr.ProcessIsSecondInstance(FProcInfo, FDupInfo) then 85 | begin 86 | LogMsg('Second instance'); 87 | self.Show; 88 | end 89 | else 90 | LogMsg('First instance'); 91 | end 92 | else 93 | LogMsg('Could not get proc info'); 94 | except 95 | on E: Exception do 96 | LogMsg('Exception:' + E.Message); 97 | end; 98 | end; 99 | 100 | procedure TDeputyInstanceManager.FormCreate(Sender: TObject); 101 | begin 102 | FProcMgr := TSEProcessManager.Create; 103 | FProcInfo := TSEProcessInfo.Create; 104 | FDupInfo := TSEProcessInfo.Create; 105 | self.Caption := self.Caption + ' v'+Maj_Ver.ToString + '.'+Min_Ver.ToString + '.'+Rel_Ver.ToString; 106 | end; 107 | 108 | procedure TDeputyInstanceManager.FormDestroy(Sender: TObject); 109 | begin 110 | FProcMgr.Free; 111 | FProcInfo.Free; 112 | FDupInfo.Free; 113 | end; 114 | 115 | procedure TDeputyInstanceManager.LogInfo; 116 | begin 117 | LogMsg('ProcID = ' + FProcInfo.ProcID.ToString); 118 | LogMsg('ParentID = ' + FProcInfo.ParentProcID.ToString); 119 | LogMsg('ProcPath = ' + FProcInfo.ImagePath); 120 | LogMsg('Command Line' + FProcInfo.CommandLine); 121 | end; 122 | 123 | procedure TDeputyInstanceManager.LogMsg(AMessage: string); 124 | begin 125 | memoLog.Lines.Add(AMessage); 126 | end; 127 | 128 | end. 129 | -------------------------------------------------------------------------------- /Source/frmDeputyOptInstanceManager.pas: -------------------------------------------------------------------------------- 1 | unit frmDeputyOptInstanceManager; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, 7 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ToolsAPI, SERTTK.DeputyTypes, Vcl.StdCtrls, Vcl.ExtCtrls; 8 | 9 | const 10 | caption_opt_label_inst_mgr = 'Deputy.Instance Manager'; 11 | MAJ_VER = 1; // Major version nr. 12 | MIN_VER = 0; // Minor version nr. 13 | REL_VER = 0; // Release nr. 14 | BLD_VER = 0; // Build nr. 15 | 16 | // Version history 17 | // v1.0.0.0 : First Release 18 | 19 | { ******************************************************************** } 20 | { written by swiftexpat } 21 | { copyright 2022 } 22 | { Email : support@swiftexpat.com } 23 | { Web : https://swiftexpat.com } 24 | { } 25 | { The source code is given as is. The author is not responsible } 26 | { for any possible damage done due to the use of this code. } 27 | { The complete source code remains property of the author and may } 28 | { not be distributed, published, given or sold in any form as such. } 29 | { No parts of the source code can be included in any other component } 30 | { or application without written authorization of the author. } 31 | { ******************************************************************** } 32 | 33 | type 34 | TfrmDeputyOptInstMgr = class(TFrame) 35 | lblDeputyInstMgrHeader: TLabel; 36 | rgInstanceManager: TRadioGroup; 37 | procedure rgInstanceManagerClick(Sender: TObject); 38 | strict private 39 | FSettings: TSERTTKDeputySettings; 40 | public 41 | property DeputySettings: TSERTTKDeputySettings read FSettings write FSettings; 42 | procedure InitializeFrame; 43 | procedure FinalizeFrame; 44 | end; 45 | 46 | TSERTTKDeputyIDEOptInstMgr = Class(TInterfacedObject, INTAAddInOptions) 47 | Strict Private 48 | FFrame: TfrmDeputyOptInstMgr; 49 | FSettings: TSERTTKDeputySettings; 50 | Public 51 | property DeputySettings: TSERTTKDeputySettings read FSettings write FSettings; 52 | Procedure DialogClosed(Accepted: Boolean); 53 | Procedure FrameCreated(AFrame: TCustomFrame); 54 | Function GetArea: String; 55 | Function GetCaption: String; 56 | Function GetFrameClass: TCustomFrameClass; 57 | Function GetHelpContext: Integer; 58 | Function IncludeInIDEInsight: Boolean; 59 | Function ValidateContents: Boolean; 60 | End; 61 | 62 | implementation 63 | 64 | {$R *.dfm} 65 | { TfrmDeputyOptInstMgr } 66 | 67 | procedure TfrmDeputyOptInstMgr.FinalizeFrame; 68 | begin 69 | 70 | end; 71 | 72 | procedure TfrmDeputyOptInstMgr.InitializeFrame; 73 | begin 74 | if Assigned(FSettings) then 75 | begin 76 | if FSettings.DetectSecondInstance then 77 | rgInstanceManager.ItemIndex := 1 78 | else 79 | rgInstanceManager.ItemIndex := 0 80 | end; 81 | end; 82 | 83 | procedure TfrmDeputyOptInstMgr.rgInstanceManagerClick(Sender: TObject); 84 | begin 85 | if rgInstanceManager.ItemIndex = 0 then 86 | FSettings.DetectSecondInstance := false 87 | else 88 | FSettings.DetectSecondInstance := true; 89 | end; 90 | 91 | { TSERTTKDeputyIDEOptInstMgr } 92 | 93 | procedure TSERTTKDeputyIDEOptInstMgr.DialogClosed(Accepted: Boolean); 94 | begin 95 | if Accepted then 96 | FFrame.FinalizeFrame; 97 | end; 98 | 99 | procedure TSERTTKDeputyIDEOptInstMgr.FrameCreated(AFrame: TCustomFrame); 100 | begin 101 | If AFrame Is TfrmDeputyOptInstMgr Then 102 | Begin 103 | FFrame := AFrame As TfrmDeputyOptInstMgr; 104 | FFrame.DeputySettings := DeputySettings; 105 | FFrame.InitializeFrame; 106 | End; 107 | end; 108 | 109 | function TSERTTKDeputyIDEOptInstMgr.GetArea: String; 110 | begin 111 | result := ''; 112 | end; 113 | 114 | function TSERTTKDeputyIDEOptInstMgr.GetCaption: String; 115 | begin 116 | result := caption_opt_label_inst_mgr; 117 | end; 118 | 119 | function TSERTTKDeputyIDEOptInstMgr.GetFrameClass: TCustomFrameClass; 120 | begin 121 | result := TfrmDeputyOptInstMgr; 122 | end; 123 | 124 | function TSERTTKDeputyIDEOptInstMgr.GetHelpContext: Integer; 125 | begin 126 | result := 0; 127 | end; 128 | 129 | function TSERTTKDeputyIDEOptInstMgr.IncludeInIDEInsight: Boolean; 130 | begin 131 | result := true; 132 | end; 133 | 134 | function TSERTTKDeputyIDEOptInstMgr.ValidateContents: Boolean; 135 | begin 136 | result := true; 137 | end; 138 | 139 | end. 140 | -------------------------------------------------------------------------------- /Source/frmDeputyOptionsInstance.pas: -------------------------------------------------------------------------------- 1 | unit frmDeputyOptionsInstance; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, 7 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, ToolsAPI, SERTTK.DeputyTypes; 8 | 9 | const 10 | caption_options_label = 'Deputy'; 11 | MAJ_VER = 1; // Major version nr. 12 | MIN_VER = 0; // Minor version nr. 13 | REL_VER = 0; // Release nr. 14 | BLD_VER = 0; // Build nr. 15 | 16 | // Version history 17 | // v1.0.0.0 : First Release 18 | 19 | { ******************************************************************** } 20 | { written by swiftexpat } 21 | { copyright 2022 } 22 | { Email : support@swiftexpat.com } 23 | { Web : https://swiftexpat.com } 24 | { } 25 | { The source code is given as is. The author is not responsible } 26 | { for any possible damage done due to the use of this code. } 27 | { The complete source code remains property of the author and may } 28 | { not be distributed, published, given or sold in any form as such. } 29 | { No parts of the source code can be included in any other component } 30 | { or application without written authorization of the author. } 31 | { ******************************************************************** } 32 | 33 | type 34 | 35 | TfrmDeputyOptInstance = class(TFrame) 36 | lblHeader: TLabel; 37 | llDocumentation: TLinkLabel; 38 | gpInstOptions: TGridPanel; 39 | llOpenSourceAcknowledge: TLinkLabel; 40 | pnlOpenSource: TPanel; 41 | llOpenSourceCommit: TLinkLabel; 42 | private 43 | FSettings: TSERTTKDeputySettings; 44 | procedure LinkClick(Sender: TObject; const Link: string; LinkType: TSysLinkType); 45 | public 46 | property DeputySettings: TSERTTKDeputySettings read FSettings write FSettings; 47 | procedure InitializeFrame; 48 | procedure FinalizeFrame; 49 | end; 50 | 51 | TSERTTKDeputyIDEOptionsInterface = Class(TInterfacedObject, INTAAddInOptions) 52 | Strict Private 53 | FFrame: TfrmDeputyOptInstance; 54 | FSettings: TSERTTKDeputySettings; 55 | Strict Protected 56 | Public 57 | property DeputySettings: TSERTTKDeputySettings read FSettings write FSettings; 58 | Procedure DialogClosed(Accepted: Boolean); 59 | Procedure FrameCreated(AFrame: TCustomFrame); 60 | Function GetArea: String; 61 | Function GetCaption: String; 62 | Function GetFrameClass: TCustomFrameClass; 63 | Function GetHelpContext: Integer; 64 | Function IncludeInIDEInsight: Boolean; 65 | Function ValidateContents: Boolean; 66 | End; 67 | 68 | implementation 69 | 70 | {$R *.dfm} 71 | 72 | uses SERTTK.DeputyExpert; 73 | { TfrmDeputyOptInstance } 74 | 75 | procedure TfrmDeputyOptInstance.FinalizeFrame; 76 | begin 77 | 78 | end; 79 | 80 | procedure TfrmDeputyOptInstance.InitializeFrame; 81 | begin 82 | llOpenSourceCommit.Caption := 'Built with Total commit ' + TOTAL_COMMIT + '' + 83 | ' and Kastri commit ' + Kastri_COMMIT + ''; 84 | llOpenSourceCommit.OnLinkClick := LinkClick; 85 | llOpenSourceAcknowledge.OnLinkClick := LinkClick; 86 | llDocumentation.OnLinkClick := LinkClick; 87 | end; 88 | 89 | procedure TfrmDeputyOptInstance.LinkClick(Sender: TObject; const Link: string; LinkType: TSysLinkType); 90 | var 91 | du: TSERTTKDeputyUtils; 92 | begin 93 | if LinkType = TSysLinkType.sltURL then 94 | begin 95 | du := TSERTTKDeputyUtils.Create; 96 | du.ShowUrl(Link); 97 | du.Free; 98 | end; 99 | end; 100 | 101 | { TSERTTKDeputyIDEOptionsInterface } 102 | 103 | procedure TSERTTKDeputyIDEOptionsInterface.DialogClosed(Accepted: Boolean); 104 | begin 105 | if Accepted then 106 | FFrame.FinalizeFrame; 107 | end; 108 | 109 | procedure TSERTTKDeputyIDEOptionsInterface.FrameCreated(AFrame: TCustomFrame); 110 | begin 111 | If AFrame Is TfrmDeputyOptInstance Then 112 | Begin 113 | FFrame := AFrame As TfrmDeputyOptInstance; 114 | FFrame.DeputySettings := DeputySettings; 115 | FFrame.InitializeFrame; 116 | End; 117 | end; 118 | 119 | function TSERTTKDeputyIDEOptionsInterface.GetArea: String; 120 | begin // return empty to place under third party 121 | result := ''; 122 | end; 123 | 124 | function TSERTTKDeputyIDEOptionsInterface.GetCaption: String; 125 | begin 126 | result := caption_options_label; 127 | end; 128 | 129 | function TSERTTKDeputyIDEOptionsInterface.GetFrameClass: TCustomFrameClass; 130 | begin 131 | result := TfrmDeputyOptInstance; 132 | end; 133 | 134 | function TSERTTKDeputyIDEOptionsInterface.GetHelpContext: Integer; 135 | begin 136 | result := 0; 137 | end; 138 | 139 | function TSERTTKDeputyIDEOptionsInterface.IncludeInIDEInsight: Boolean; 140 | begin 141 | result := true; 142 | end; 143 | 144 | function TSERTTKDeputyIDEOptionsInterface.ValidateContents: Boolean; 145 | begin // called when OK is selected 146 | result := true; 147 | end; 148 | 149 | end. 150 | -------------------------------------------------------------------------------- /DevTools/DeputyFormHarness/frmDeputyFormHarness.pas: -------------------------------------------------------------------------------- 1 | unit frmDeputyFormHarness; 2 | 3 | {$WARN SYMBOL_PLATFORM OFF} 4 | 5 | interface 6 | 7 | uses 8 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 9 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, SE.ProcMgrUtils, SERTTK.DeputyTypes, Vcl.Grids, 10 | Vcl.Samples.DirOutln, Vcl.FileCtrl, Vcl.ExtCtrls; 11 | 12 | type 13 | TfrmDeputyHarness = class(TForm) 14 | pcMain: TPageControl; 15 | tsProcMgr: TTabSheet; 16 | btnProcMgrShow: TButton; 17 | memoProcMgrMessage: TMemo; 18 | lblProcDir: TLabel; 19 | lblProcName: TLabel; 20 | bntProcTest: TButton; 21 | valDirName: TLabel; 22 | OpenDialog1: TOpenDialog; 23 | valProcName: TLabel; 24 | btnSelectProc: TButton; 25 | tsIdeInstance: TTabSheet; 26 | GridPanel1: TGridPanel; 27 | lblIde1: TLabel; 28 | btnStartIde1: TButton; 29 | lblIde2: TLabel; 30 | btnStartIde2: TButton; 31 | lblPidIDE1: TLabel; 32 | lblPidIDE2: TLabel; 33 | editIde1Params: TEdit; 34 | editIde2Params: TEdit; 35 | tsUpdates: TTabSheet; 36 | btnStartProc: TButton; 37 | procedure btnProcMgrShowClick(Sender: TObject); 38 | procedure FormCreate(Sender: TObject); 39 | procedure FormDestroy(Sender: TObject); 40 | procedure bntProcTestClick(Sender: TObject); 41 | procedure btnSelectProcClick(Sender: TObject); 42 | procedure btnStartIde1Click(Sender: TObject); 43 | procedure btnStartIde2Click(Sender: TObject); 44 | procedure btnStartProcClick(Sender: TObject); 45 | 46 | private 47 | // FProcMgr: TSEProcessManager; 48 | FSettings: TSERTTKDeputySettings; 49 | FToolsDir: string; 50 | procedure SetToolsDir; 51 | procedure LogMsg(AMessage: string); 52 | public 53 | { Public declarations } 54 | end; 55 | 56 | var 57 | frmDeputyHarness: TfrmDeputyHarness; 58 | 59 | implementation 60 | 61 | {$R *.dfm} 62 | 63 | uses System.IOUtils, frmDeputyProcMgr, ShellAPI; 64 | 65 | const 66 | proc_dir = 'C:\Repos\Github\Deputy\DevTools\LeakTests\Win32\Debug'; 67 | proc_name = 'ShowLeakMessage.exe'; 68 | ide_emulator = 'idebds.exe'; 69 | ide_emulatordir = 'IDEEmulator\Win32\Debug'; 70 | harness_dir = 'DeputyFormHarness\Win32\Debug'; 71 | leakapp_dir = 'LeakTests\Win32\Debug'; 72 | 73 | procedure TfrmDeputyHarness.bntProcTestClick(Sender: TObject); 74 | var 75 | fmgr: TDeputyProcMgr; 76 | rslt: boolean; 77 | begin 78 | fmgr := TDeputyProcMgrFactory.DeputyProcMgr; 79 | fmgr.AssignSettings(FSettings); 80 | rslt := fmgr.ClearProcess(valProcName.Caption, valDirName.Caption); 81 | if rslt then 82 | LogMsg('Process cleared') 83 | else 84 | LogMsg('Unable to clear Process') 85 | 86 | end; 87 | 88 | procedure TfrmDeputyHarness.btnProcMgrShowClick(Sender: TObject); 89 | var 90 | fmgr: TDeputyProcMgr; 91 | begin 92 | fmgr := TDeputyProcMgrFactory.DeputyProcMgr; 93 | fmgr.AssignSettings(FSettings); 94 | fmgr.Show; 95 | end; 96 | 97 | procedure TfrmDeputyHarness.btnSelectProcClick(Sender: TObject); 98 | var 99 | rslt: boolean; 100 | begin 101 | OpenDialog1.InitialDir := valDirName.Caption; 102 | 103 | rslt := OpenDialog1.Execute; 104 | if rslt then 105 | begin 106 | LogMsg('Change file to: ' + OpenDialog1.FileName); 107 | valProcName.Caption := TPath.GetFileName(OpenDialog1.FileName); 108 | valDirName.Caption := TPath.GetDirectoryName(OpenDialog1.FileName); 109 | end 110 | else 111 | LogMsg('Abort File choose'); 112 | end; 113 | 114 | procedure TfrmDeputyHarness.btnStartIde1Click(Sender: TObject); 115 | var 116 | edir: string; 117 | begin 118 | edir := TPath.Combine(FToolsDir, ide_emulatordir); 119 | // logMsg('edir= ' + Edir); 120 | ShellExecute(0, PChar('open'), PChar(AnsiQuotedStr(ide_emulator, Char(34))), PChar(editIde1Params.Text), PChar(edir), 121 | SW_NORMAL); 122 | end; 123 | 124 | procedure TfrmDeputyHarness.btnStartIde2Click(Sender: TObject); 125 | begin 126 | ShellExecute(0, PChar('open'), PChar(AnsiQuotedStr(ide_emulator, Char(34))), PChar(editIde2Params.Text), 127 | PChar(TPath.Combine(FToolsDir, ide_emulatordir)), SW_NORMAL); 128 | end; 129 | 130 | procedure TfrmDeputyHarness.btnStartProcClick(Sender: TObject); 131 | begin 132 | ShellExecute(0, PChar('open'), PChar(AnsiQuotedStr(proc_name, Char(34))), PChar(''), 133 | PChar(TPath.Combine(FToolsDir, leakapp_dir)), SW_NORMAL); 134 | end; 135 | 136 | procedure TfrmDeputyHarness.FormCreate(Sender: TObject); 137 | begin 138 | FSettings := TSERTTKDeputySettings.Create(TSERTTKDeputySettings.nm_settings_regkey); 139 | valProcName.Caption := proc_name; 140 | valDirName.Caption := proc_dir; 141 | SetToolsDir; 142 | end; 143 | 144 | procedure TfrmDeputyHarness.FormDestroy(Sender: TObject); 145 | begin 146 | FSettings.free; 147 | end; 148 | 149 | procedure TfrmDeputyHarness.LogMsg(AMessage: string); 150 | begin 151 | memoProcMgrMessage.Lines.Add(AMessage); 152 | end; 153 | 154 | procedure TfrmDeputyHarness.SetToolsDir; 155 | var 156 | q1: integer; 157 | rl: string; 158 | begin 159 | rl := cmdLine; 160 | q1 := rl.IndexOf('"'); 161 | FToolsDir := rl.Substring((q1 + 1), rl.IndexOf('"', (q1 + 1)) - 1); 162 | FToolsDir := TPath.GetDirectoryName(FToolsDir).Replace(harness_dir, ''); 163 | LogMsg('Tools dir = ' + FToolsDir); 164 | end; 165 | 166 | end. 167 | -------------------------------------------------------------------------------- /Source/frmDeputyProcMgr.dfm: -------------------------------------------------------------------------------- 1 | object DeputyProcMgr: TDeputyProcMgr 2 | Left = 0 3 | Top = 0 4 | Caption = 'Deputy Process Manager' 5 | ClientHeight = 634 6 | ClientWidth = 815 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | Position = poMainFormCenter 14 | OnClose = FormClose 15 | OnCreate = FormCreate 16 | OnDestroy = FormDestroy 17 | OnShow = FormShow 18 | TextHeight = 15 19 | object sbMain: TStatusBar 20 | Left = 0 21 | Top = 615 22 | Width = 815 23 | Height = 19 24 | Panels = < 25 | item 26 | Text = 'Idle' 27 | Width = 50 28 | end> 29 | end 30 | object pcWorkarea: TPageControl 31 | Left = 0 32 | Top = 0 33 | Width = 815 34 | Height = 615 35 | ActivePage = tsStatus 36 | Align = alClient 37 | TabOrder = 1 38 | object tsStatus: TTabSheet 39 | Caption = 'Status' 40 | object memoLeakStatus: TMemo 41 | Left = 0 42 | Top = 97 43 | Width = 807 44 | Height = 488 45 | Align = alClient 46 | ScrollBars = ssBoth 47 | TabOrder = 0 48 | end 49 | object lbMgrStatus: TListBox 50 | Left = 0 51 | Top = 0 52 | Width = 807 53 | Height = 97 54 | Align = alTop 55 | ItemHeight = 15 56 | TabOrder = 1 57 | end 58 | end 59 | object tsHistory: TTabSheet 60 | Caption = 'History' 61 | ImageIndex = 2 62 | object lvHist: TListView 63 | Left = 0 64 | Top = 0 65 | Width = 807 66 | Height = 120 67 | Align = alTop 68 | Checkboxes = True 69 | Columns = < 70 | item 71 | AutoSize = True 72 | Caption = 'Process' 73 | end 74 | item 75 | AutoSize = True 76 | Caption = 'Start' 77 | end 78 | item 79 | AutoSize = True 80 | Caption = 'Stop' 81 | end 82 | item 83 | AutoSize = True 84 | Caption = 'Elapsed ms' 85 | end 86 | item 87 | AutoSize = True 88 | Caption = 'Proc Found' 89 | end 90 | item 91 | AutoSize = True 92 | Caption = 'Leak Shown' 93 | end> 94 | ReadOnly = True 95 | RowSelect = True 96 | ParentShowHint = False 97 | ShowHint = True 98 | TabOrder = 0 99 | ViewStyle = vsReport 100 | OnInfoTip = lvHistInfoTip 101 | OnSelectItem = lvHistSelectItem 102 | end 103 | object memoLeakHist: TMemo 104 | Left = 0 105 | Top = 120 106 | Width = 807 107 | Height = 465 108 | Align = alClient 109 | ScrollBars = ssBoth 110 | TabOrder = 1 111 | end 112 | end 113 | end 114 | object gpCleanStatus: TGridPanel 115 | Left = 328 116 | Top = 240 117 | Width = 185 118 | Height = 80 119 | BorderWidth = 1 120 | BorderStyle = bsSingle 121 | Caption = 'gpCleanStatus' 122 | ColumnCollection = < 123 | item 124 | Value = 50.000000000000000000 125 | end 126 | item 127 | Value = 50.000000000000000000 128 | end> 129 | ControlCollection = < 130 | item 131 | Column = 0 132 | Control = lblHdrLoopCount 133 | Row = 0 134 | end 135 | item 136 | Column = 1 137 | Control = lblLoopCount 138 | Row = 0 139 | end 140 | item 141 | Column = 1 142 | Control = btnAbortCleanup 143 | Row = 2 144 | end 145 | item 146 | Column = 0 147 | Control = lblHdrElapsed 148 | Row = 1 149 | end 150 | item 151 | Column = 1 152 | Control = lblElapsedMS 153 | Row = 1 154 | end 155 | item 156 | Column = 0 157 | Control = btnForceTerminate 158 | Row = 2 159 | end> 160 | RowCollection = < 161 | item 162 | Value = 27.028124982687920000 163 | end 164 | item 165 | Value = 31.804834819149520000 166 | end 167 | item 168 | Value = 41.167040198162570000 169 | end> 170 | ShowCaption = False 171 | TabOrder = 2 172 | Visible = False 173 | object lblHdrLoopCount: TLabel 174 | Left = 2 175 | Top = 2 176 | Width = 88 177 | Height = 19 178 | Align = alClient 179 | Alignment = taRightJustify 180 | Caption = 'Loop Count =' 181 | ExplicitLeft = 16 182 | ExplicitWidth = 74 183 | ExplicitHeight = 15 184 | end 185 | object lblLoopCount: TLabel 186 | Left = 90 187 | Top = 2 188 | Width = 89 189 | Height = 19 190 | Align = alClient 191 | Caption = 'lblLoopCount' 192 | ExplicitWidth = 73 193 | ExplicitHeight = 15 194 | end 195 | object btnAbortCleanup: TButton 196 | AlignWithMargins = True 197 | Left = 92 198 | Top = 45 199 | Width = 86 200 | Height = 28 201 | Margins.Left = 2 202 | Margins.Top = 1 203 | Margins.Right = 1 204 | Margins.Bottom = 1 205 | Align = alClient 206 | Caption = 'Abort Cleanup' 207 | TabOrder = 0 208 | OnClick = btnAbortCleanupClick 209 | end 210 | object lblHdrElapsed: TLabel 211 | Left = 2 212 | Top = 21 213 | Width = 88 214 | Height = 23 215 | Align = alClient 216 | Alignment = taRightJustify 217 | Caption = 'Elapsed ms = ' 218 | ExplicitLeft = 17 219 | ExplicitWidth = 73 220 | ExplicitHeight = 15 221 | end 222 | object lblElapsedMS: TLabel 223 | Left = 90 224 | Top = 21 225 | Width = 89 226 | Height = 23 227 | Align = alClient 228 | Caption = '0' 229 | ExplicitWidth = 6 230 | ExplicitHeight = 15 231 | end 232 | object btnForceTerminate: TButton 233 | AlignWithMargins = True 234 | Left = 3 235 | Top = 45 236 | Width = 85 237 | Height = 28 238 | Margins.Left = 1 239 | Margins.Top = 1 240 | Margins.Right = 2 241 | Margins.Bottom = 1 242 | Align = alClient 243 | Caption = 'Force Terminate' 244 | TabOrder = 1 245 | OnClick = btnForceTerminateClick 246 | end 247 | end 248 | object tmrCleanupStatus: TTimer 249 | Enabled = False 250 | Interval = 100 251 | OnTimer = tmrCleanupStatusTimer 252 | Left = 400 253 | Top = 328 254 | end 255 | end 256 | -------------------------------------------------------------------------------- /Source/frmDeputyOptProcessManager.pas: -------------------------------------------------------------------------------- 1 | unit frmDeputyOptProcessManager; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, 7 | Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ToolsAPI, SERTTK.DeputyTypes, Vcl.ExtCtrls, Vcl.StdCtrls, 8 | Vcl.Samples.Spin, SE.ProcMgrUtils; 9 | 10 | const 11 | caption_opt_label_proc_mgr = 'Deputy.Process Manager'; 12 | MAJ_VER = 1; // Major version nr. 13 | MIN_VER = 0; // Minor version nr. 14 | REL_VER = 0; // Release nr. 15 | BLD_VER = 0; // Build nr. 16 | 17 | // Version history 18 | // v1.0.0.0 : First Release 19 | 20 | { ******************************************************************** } 21 | { written by swiftexpat } 22 | { copyright 2022 } 23 | { Email : support@swiftexpat.com } 24 | { Web : https://swiftexpat.com } 25 | { } 26 | { The source code is given as is. The author is not responsible } 27 | { for any possible damage done due to the use of this code. } 28 | { The complete source code remains property of the author and may } 29 | { not be distributed, published, given or sold in any form as such. } 30 | { No parts of the source code can be included in any other component } 31 | { or application without written authorization of the author. } 32 | { ******************************************************************** } 33 | 34 | type 35 | TfrmDeputyOptProcMgr = class(TFrame) 36 | llHeader: TLinkLabel; 37 | rgProcMgrActive: TRadioGroup; 38 | rgProcStopCommand: TRadioGroup; 39 | cbCloseLeakWindow: TCheckBox; 40 | cbCopyLeakMessage: TCheckBox; 41 | gpTimeouts: TGridPanel; 42 | lblHdrTimeouts: TLabel; 43 | lblWaitPollTimeout: TLabel; 44 | edtWaitPoll: TSpinEdit; 45 | lblHdrShowDelay: TLabel; 46 | edtShowDelay: TSpinEdit; 47 | gpOptions: TGridPanel; 48 | memoMessage: TMemo; 49 | gpMainLayout: TGridPanel; 50 | procedure rgProcMgrActiveClick(Sender: TObject); 51 | procedure rgProcStopCommandClick(Sender: TObject); 52 | procedure cbCloseLeakWindowClick(Sender: TObject); 53 | procedure cbCopyLeakMessageClick(Sender: TObject); 54 | procedure edtWaitPollChange(Sender: TObject); 55 | procedure edtShowDelayChange(Sender: TObject); 56 | strict private 57 | FSettings: TSERTTKDeputySettings; 58 | FStopCommand: TSEProcessStopCommand; 59 | procedure UpdateSettings; 60 | public 61 | property DeputySettings: TSERTTKDeputySettings read FSettings write FSettings; 62 | procedure InitializeFrame; 63 | procedure FinalizeFrame; 64 | end; 65 | 66 | TSERTTKDeputyIDEOptProcMgr = Class(TInterfacedObject, INTAAddInOptions) 67 | Strict Private 68 | FFrame: TfrmDeputyOptProcMgr; 69 | FSettings: TSERTTKDeputySettings; 70 | Public 71 | property DeputySettings: TSERTTKDeputySettings read FSettings write FSettings; 72 | Procedure DialogClosed(Accepted: Boolean); 73 | Procedure FrameCreated(AFrame: TCustomFrame); 74 | Function GetArea: String; 75 | Function GetCaption: String; 76 | Function GetFrameClass: TCustomFrameClass; 77 | Function GetHelpContext: Integer; 78 | Function IncludeInIDEInsight: Boolean; 79 | Function ValidateContents: Boolean; 80 | End; 81 | 82 | implementation 83 | 84 | {$R *.dfm} 85 | { TfrmDeputyOptProcMgr } 86 | 87 | procedure TfrmDeputyOptProcMgr.cbCloseLeakWindowClick(Sender: TObject); 88 | begin 89 | if cbCloseLeakWindow.Checked then 90 | FSettings.CloseLeakWindow := true 91 | else 92 | FSettings.CloseLeakWindow := false; 93 | UpdateSettings; 94 | end; 95 | 96 | procedure TfrmDeputyOptProcMgr.cbCopyLeakMessageClick(Sender: TObject); 97 | begin 98 | if cbCopyLeakMessage.Checked then 99 | FSettings.CopyLeakMessage := true 100 | else 101 | FSettings.CopyLeakMessage := false; 102 | UpdateSettings; 103 | end; 104 | 105 | procedure TfrmDeputyOptProcMgr.edtShowDelayChange(Sender: TObject); 106 | begin 107 | if (edtShowDelay.Value > edtShowDelay.MinValue) and (edtShowDelay.Value < edtShowDelay.MaxValue) then 108 | FSettings.ShowWindowDelay := edtShowDelay.Value; 109 | end; 110 | 111 | procedure TfrmDeputyOptProcMgr.edtWaitPollChange(Sender: TObject); 112 | begin 113 | if (edtWaitPoll.Value > edtWaitPoll.MinValue) and (edtWaitPoll.Value < edtWaitPoll.MaxValue) then 114 | FSettings.WaitPollInterval := edtWaitPoll.Value; 115 | end; 116 | 117 | procedure TfrmDeputyOptProcMgr.FinalizeFrame; 118 | begin 119 | 120 | end; 121 | 122 | procedure TfrmDeputyOptProcMgr.InitializeFrame; 123 | begin 124 | if assigned(FSettings) then 125 | begin 126 | UpdateSettings; 127 | edtWaitPoll.Value := FSettings.WaitPollInterval; 128 | edtShowDelay.Value := FSettings.ShowWindowDelay; 129 | rgProcMgrActive.OnClick := rgProcMgrActiveClick; 130 | rgProcStopCommand.OnClick := rgProcStopCommandClick; 131 | cbCloseLeakWindow.OnClick := cbCloseLeakWindowClick; 132 | cbCopyLeakMessage.OnClick := cbCopyLeakMessageClick; 133 | end; 134 | 135 | end; 136 | 137 | procedure TfrmDeputyOptProcMgr.rgProcStopCommandClick(Sender: TObject); 138 | begin 139 | FSettings.StopCommand := rgProcStopCommand.ItemIndex; 140 | UpdateSettings; 141 | end; 142 | 143 | procedure TfrmDeputyOptProcMgr.rgProcMgrActiveClick(Sender: TObject); 144 | begin 145 | if rgProcMgrActive.ItemIndex = 0 then 146 | FSettings.KillProcActive := false 147 | else 148 | FSettings.KillProcActive := true; 149 | UpdateSettings; 150 | end; 151 | 152 | procedure TfrmDeputyOptProcMgr.UpdateSettings; 153 | begin 154 | if FSettings.KillProcActive then 155 | begin 156 | rgProcMgrActive.ItemIndex := 1; 157 | rgProcStopCommand.ItemIndex := FSettings.StopCommand; 158 | FStopCommand := TSEProcessStopCommand(FSettings.StopCommand); 159 | rgProcStopCommand.Visible := true; 160 | case FStopCommand of 161 | tseProcStopKill: 162 | begin 163 | cbCloseLeakWindow.Visible := false; 164 | cbCopyLeakMessage.Visible := false; 165 | end; 166 | tseProcStopClose: 167 | begin 168 | cbCloseLeakWindow.Checked := FSettings.CloseLeakWindow; 169 | cbCopyLeakMessage.Checked := FSettings.CopyLeakMessage; 170 | cbCloseLeakWindow.Visible := true; 171 | cbCopyLeakMessage.Visible := cbCloseLeakWindow.Checked; 172 | end; 173 | end; 174 | end 175 | else 176 | begin 177 | rgProcMgrActive.ItemIndex := 0; 178 | rgProcStopCommand.Visible := false; 179 | cbCloseLeakWindow.Visible := false; 180 | cbCopyLeakMessage.Visible := false; 181 | end; 182 | end; 183 | 184 | { TSERTTKDeputyIDEOptProcMgr } 185 | 186 | procedure TSERTTKDeputyIDEOptProcMgr.DialogClosed(Accepted: Boolean); 187 | begin 188 | if Accepted then 189 | FFrame.FinalizeFrame; 190 | end; 191 | 192 | procedure TSERTTKDeputyIDEOptProcMgr.FrameCreated(AFrame: TCustomFrame); 193 | begin 194 | If AFrame Is TfrmDeputyOptProcMgr Then 195 | Begin 196 | FFrame := AFrame As TfrmDeputyOptProcMgr; 197 | FFrame.DeputySettings := DeputySettings; 198 | FFrame.InitializeFrame; 199 | End; 200 | end; 201 | 202 | function TSERTTKDeputyIDEOptProcMgr.GetArea: String; 203 | begin 204 | result := ''; 205 | end; 206 | 207 | function TSERTTKDeputyIDEOptProcMgr.GetCaption: String; 208 | begin 209 | result := caption_opt_label_proc_mgr; 210 | end; 211 | 212 | function TSERTTKDeputyIDEOptProcMgr.GetFrameClass: TCustomFrameClass; 213 | begin 214 | result := TfrmDeputyOptProcMgr; 215 | end; 216 | 217 | function TSERTTKDeputyIDEOptProcMgr.GetHelpContext: Integer; 218 | begin 219 | result := 0; 220 | end; 221 | 222 | function TSERTTKDeputyIDEOptProcMgr.IncludeInIDEInsight: Boolean; 223 | begin 224 | result := true; 225 | end; 226 | 227 | function TSERTTKDeputyIDEOptProcMgr.ValidateContents: Boolean; 228 | begin 229 | result := true; 230 | end; 231 | 232 | end. 233 | -------------------------------------------------------------------------------- /DevTools/DeputyFormHarness/frmDeputyFormHarness.dfm: -------------------------------------------------------------------------------- 1 | object frmDeputyHarness: TfrmDeputyHarness 2 | Left = 0 3 | Top = 0 4 | Caption = 'Deputy Form Harness' 5 | ClientHeight = 593 6 | ClientWidth = 944 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | OnCreate = FormCreate 14 | OnDestroy = FormDestroy 15 | TextHeight = 15 16 | object pcMain: TPageControl 17 | Left = 0 18 | Top = 0 19 | Width = 944 20 | Height = 368 21 | ActivePage = tsProcMgr 22 | Align = alClient 23 | TabOrder = 0 24 | object tsProcMgr: TTabSheet 25 | Caption = 'Process Manager' 26 | object lblProcDir: TLabel 27 | Left = 24 28 | Top = 80 29 | Width = 88 30 | Height = 15 31 | Caption = 'ProcessDirectory' 32 | end 33 | object lblProcName: TLabel 34 | Left = 24 35 | Top = 120 36 | Width = 75 37 | Height = 15 38 | Caption = 'Process Name' 39 | end 40 | object valDirName: TLabel 41 | Left = 160 42 | Top = 80 43 | Width = 112 44 | Height = 15 45 | Caption = 'C:\...\Studio\22.0\bin' 46 | end 47 | object valProcName: TLabel 48 | Left = 160 49 | Top = 120 50 | Width = 116 51 | Height = 15 52 | Caption = 'valProcName.Caption' 53 | end 54 | object btnProcMgrShow: TButton 55 | Left = 24 56 | Top = 16 57 | Width = 137 58 | Height = 25 59 | Caption = 'Show Proc Mgr' 60 | TabOrder = 0 61 | OnClick = btnProcMgrShowClick 62 | end 63 | object bntProcTest: TButton 64 | Left = 24 65 | Top = 256 66 | Width = 145 67 | Height = 25 68 | Caption = 'Test Proc Mgr' 69 | TabOrder = 1 70 | OnClick = bntProcTestClick 71 | end 72 | object btnSelectProc: TButton 73 | Left = 24 74 | Top = 152 75 | Width = 137 76 | Height = 25 77 | Caption = 'Select Process' 78 | TabOrder = 2 79 | OnClick = btnSelectProcClick 80 | end 81 | object btnStartProc: TButton 82 | Left = 232 83 | Top = 152 84 | Width = 145 85 | Height = 25 86 | Caption = 'Start Leak Process' 87 | TabOrder = 3 88 | OnClick = btnStartProcClick 89 | end 90 | end 91 | object tsIdeInstance: TTabSheet 92 | Caption = 'Ide Instance Mgr' 93 | ImageIndex = 1 94 | object GridPanel1: TGridPanel 95 | Left = 10 96 | Top = 10 97 | Width = 640 98 | Height = 64 99 | BorderStyle = bsSingle 100 | ColumnCollection = < 101 | item 102 | SizeStyle = ssAbsolute 103 | Value = 72.000000000000000000 104 | end 105 | item 106 | SizeStyle = ssAbsolute 107 | Value = 96.000000000000000000 108 | end 109 | item 110 | SizeStyle = ssAbsolute 111 | Value = 96.000000000000000000 112 | end 113 | item 114 | Value = 100.000000000000000000 115 | end> 116 | ControlCollection = < 117 | item 118 | Column = 0 119 | Control = lblIde1 120 | Row = 0 121 | end 122 | item 123 | Column = 1 124 | Control = btnStartIde1 125 | Row = 0 126 | end 127 | item 128 | Column = 0 129 | Control = lblIde2 130 | Row = 1 131 | end 132 | item 133 | Column = 1 134 | Control = btnStartIde2 135 | Row = 1 136 | end 137 | item 138 | Column = 2 139 | Control = lblPidIDE1 140 | Row = 0 141 | end 142 | item 143 | Column = 2 144 | Control = lblPidIDE2 145 | Row = 1 146 | end 147 | item 148 | Column = 3 149 | Control = editIde1Params 150 | Row = 0 151 | end 152 | item 153 | Column = 3 154 | Control = editIde2Params 155 | Row = 1 156 | end> 157 | RowCollection = < 158 | item 159 | Value = 50.000000000000000000 160 | end 161 | item 162 | Value = 50.000000000000000000 163 | end> 164 | ShowCaption = False 165 | TabOrder = 0 166 | object lblIde1: TLabel 167 | Left = 1 168 | Top = 1 169 | Width = 72 170 | Height = 29 171 | Align = alClient 172 | Alignment = taCenter 173 | Caption = 'IDE Instance 1' 174 | Layout = tlCenter 175 | ExplicitWidth = 73 176 | ExplicitHeight = 15 177 | end 178 | object btnStartIde1: TButton 179 | AlignWithMargins = True 180 | Left = 76 181 | Top = 4 182 | Width = 90 183 | Height = 23 184 | Align = alClient 185 | Caption = 'Start IDE 1' 186 | TabOrder = 0 187 | OnClick = btnStartIde1Click 188 | end 189 | object lblIde2: TLabel 190 | Left = 1 191 | Top = 30 192 | Width = 72 193 | Height = 29 194 | Align = alClient 195 | Alignment = taCenter 196 | Caption = 'IDE Instance 2' 197 | Layout = tlCenter 198 | ExplicitWidth = 73 199 | ExplicitHeight = 15 200 | end 201 | object btnStartIde2: TButton 202 | AlignWithMargins = True 203 | Left = 76 204 | Top = 33 205 | Width = 90 206 | Height = 23 207 | Align = alClient 208 | Caption = 'Start IDE 2' 209 | TabOrder = 1 210 | OnClick = btnStartIde2Click 211 | end 212 | object lblPidIDE1: TLabel 213 | AlignWithMargins = True 214 | Left = 172 215 | Top = 4 216 | Width = 90 217 | Height = 23 218 | Align = alClient 219 | Caption = 'PID = ######' 220 | Layout = tlCenter 221 | ExplicitWidth = 74 222 | ExplicitHeight = 15 223 | end 224 | object lblPidIDE2: TLabel 225 | AlignWithMargins = True 226 | Left = 172 227 | Top = 33 228 | Width = 90 229 | Height = 23 230 | Align = alClient 231 | Caption = 'PID = ######' 232 | Layout = tlCenter 233 | ExplicitWidth = 74 234 | ExplicitHeight = 15 235 | end 236 | object editIde1Params: TEdit 237 | AlignWithMargins = True 238 | Left = 268 239 | Top = 4 240 | Width = 364 241 | Height = 23 242 | Align = alClient 243 | TabOrder = 2 244 | Text = '-np -r SEIEDev -pDelphi' 245 | end 246 | object editIde2Params: TEdit 247 | AlignWithMargins = True 248 | Left = 268 249 | Top = 33 250 | Width = 364 251 | Height = 23 252 | Align = alClient 253 | TabOrder = 3 254 | Text = '-np -r SEIEDev -pDelphi' 255 | end 256 | end 257 | end 258 | object tsUpdates: TTabSheet 259 | Caption = 'tsUpdates' 260 | ImageIndex = 2 261 | end 262 | end 263 | object memoProcMgrMessage: TMemo 264 | Left = 0 265 | Top = 368 266 | Width = 944 267 | Height = 225 268 | Align = alBottom 269 | Lines.Strings = ( 270 | 'memoProcMgrMessage') 271 | TabOrder = 1 272 | end 273 | object OpenDialog1: TOpenDialog 274 | DefaultExt = 'exe' 275 | Filter = 'Executables (*.exe)|*.EXE' 276 | Title = 'Choose file for Deputy to manage' 277 | Left = 712 278 | Top = 112 279 | end 280 | end 281 | -------------------------------------------------------------------------------- /Source/frmDeputyOptProcessManager.dfm: -------------------------------------------------------------------------------- 1 | object frmDeputyOptProcMgr: TfrmDeputyOptProcMgr 2 | Left = 0 3 | Top = 0 4 | Width = 762 5 | Height = 480 6 | TabOrder = 0 7 | object llHeader: TLinkLabel 8 | AlignWithMargins = True 9 | Left = 3 10 | Top = 3 11 | Width = 756 12 | Height = 29 13 | Align = alTop 14 | Caption = 15 | 'Process Manager configuration options , hover to show the hint e' + 16 | 'xplainations.' 17 | TabOrder = 0 18 | ExplicitWidth = 621 19 | end 20 | object gpMainLayout: TGridPanel 21 | Left = 0 22 | Top = 35 23 | Width = 762 24 | Height = 445 25 | Align = alClient 26 | Caption = 'gpMainLayout' 27 | ColumnCollection = < 28 | item 29 | Value = 100.000000000000000000 30 | end> 31 | ControlCollection = < 32 | item 33 | Column = 0 34 | Control = gpOptions 35 | Row = 0 36 | end 37 | item 38 | Column = 0 39 | Control = gpTimeouts 40 | Row = 1 41 | end 42 | item 43 | Column = 0 44 | Control = memoMessage 45 | Row = 2 46 | end> 47 | RowCollection = < 48 | item 49 | SizeStyle = ssAbsolute 50 | Value = 120.000000000000000000 51 | end 52 | item 53 | SizeStyle = ssAbsolute 54 | Value = 164.000000000000000000 55 | end 56 | item 57 | Value = 100.000000000000000000 58 | end> 59 | ShowCaption = False 60 | TabOrder = 1 61 | object gpOptions: TGridPanel 62 | AlignWithMargins = True 63 | Left = 4 64 | Top = 4 65 | Width = 754 66 | Height = 117 67 | Align = alTop 68 | Anchors = [] 69 | Caption = 'gp' 70 | ColumnCollection = < 71 | item 72 | SizeStyle = ssAbsolute 73 | Value = 164.000000000000000000 74 | end 75 | item 76 | SizeStyle = ssAbsolute 77 | Value = 164.000000000000000000 78 | end 79 | item 80 | Value = 100.000000000000000000 81 | end> 82 | ControlCollection = < 83 | item 84 | Column = 0 85 | Control = rgProcMgrActive 86 | Row = 0 87 | RowSpan = 2 88 | end 89 | item 90 | Column = 1 91 | Control = rgProcStopCommand 92 | Row = 0 93 | RowSpan = 2 94 | end 95 | item 96 | Column = 2 97 | Control = cbCloseLeakWindow 98 | Row = 0 99 | end 100 | item 101 | Column = 2 102 | Control = cbCopyLeakMessage 103 | Row = 1 104 | end> 105 | RowCollection = < 106 | item 107 | Value = 50.000000000000000000 108 | end 109 | item 110 | Value = 50.000000000000000000 111 | end> 112 | ShowCaption = False 113 | TabOrder = 0 114 | object rgProcMgrActive: TRadioGroup 115 | AlignWithMargins = True 116 | Left = 4 117 | Top = 4 118 | Width = 158 119 | Height = 109 120 | Hint = 'Disables Process Manager for compile and debug' 121 | Align = alClient 122 | Caption = 'Process Manager' 123 | Items.Strings = ( 124 | 'Disabled' 125 | 'Enabled') 126 | TabOrder = 0 127 | end 128 | object rgProcStopCommand: TRadioGroup 129 | AlignWithMargins = True 130 | Left = 168 131 | Top = 4 132 | Width = 158 133 | Height = 109 134 | Hint = 135 | 'Terminate uses process terminate and close sends a wm_close mess' + 136 | 'age' 137 | Align = alClient 138 | Caption = 'Terminate Action' 139 | Items.Strings = ( 140 | 'Terminate' 141 | 'Close') 142 | TabOrder = 1 143 | OnClick = rgProcStopCommandClick 144 | end 145 | object cbCloseLeakWindow: TCheckBox 146 | AlignWithMargins = True 147 | Left = 332 148 | Top = 4 149 | Width = 418 150 | Height = 52 151 | Hint = 'Close possible memory leak window' 152 | Align = alClient 153 | Caption = 'Close Leak Window' 154 | TabOrder = 2 155 | OnClick = cbCloseLeakWindowClick 156 | end 157 | object cbCopyLeakMessage: TCheckBox 158 | AlignWithMargins = True 159 | Left = 332 160 | Top = 62 161 | Width = 418 162 | Height = 51 163 | Hint = 'Copy memory leak message to history' 164 | Align = alClient 165 | Caption = 'Copy Leak Message' 166 | TabOrder = 3 167 | OnClick = cbCopyLeakMessageClick 168 | end 169 | end 170 | object gpTimeouts: TGridPanel 171 | AlignWithMargins = True 172 | Left = 4 173 | Top = 124 174 | Width = 445 175 | Height = 158 176 | Align = alLeft 177 | BorderWidth = 1 178 | BorderStyle = bsSingle 179 | ColumnCollection = < 180 | item 181 | SizeStyle = ssAbsolute 182 | Value = 240.000000000000000000 183 | end 184 | item 185 | SizeStyle = ssAbsolute 186 | Value = 96.000000000000000000 187 | end> 188 | ControlCollection = < 189 | item 190 | Column = 0 191 | ColumnSpan = 2 192 | Control = lblHdrTimeouts 193 | Row = 0 194 | end 195 | item 196 | Column = 0 197 | Control = lblWaitPollTimeout 198 | Row = 1 199 | end 200 | item 201 | Column = 1 202 | Control = edtWaitPoll 203 | Row = 1 204 | end 205 | item 206 | Column = 0 207 | Control = lblHdrShowDelay 208 | Row = 2 209 | end 210 | item 211 | Column = 1 212 | Control = edtShowDelay 213 | Row = 2 214 | end> 215 | RowCollection = < 216 | item 217 | SizeStyle = ssAbsolute 218 | Value = 32.000000000000000000 219 | end 220 | item 221 | SizeStyle = ssAbsolute 222 | Value = 42.000000000000000000 223 | end 224 | item 225 | SizeStyle = ssAbsolute 226 | Value = 42.000000000000000000 227 | end 228 | item 229 | Value = 100.000000000000000000 230 | end> 231 | ShowCaption = False 232 | TabOrder = 1 233 | object lblHdrTimeouts: TLabel 234 | AlignWithMargins = True 235 | Left = 5 236 | Top = 5 237 | Width = 330 238 | Height = 26 239 | Align = alClient 240 | Alignment = taCenter 241 | Caption = 'Process Manager Timeouts' 242 | ExplicitWidth = 213 243 | ExplicitHeight = 25 244 | end 245 | object lblWaitPollTimeout: TLabel 246 | Left = 2 247 | Top = 34 248 | Width = 240 249 | Height = 42 250 | Hint = 'Controls loop time waiting for the process to close' 251 | Align = alClient 252 | Alignment = taRightJustify 253 | Caption = 'WaitPoll Interval (ms)' 254 | Layout = tlCenter 255 | ExplicitLeft = 77 256 | ExplicitWidth = 165 257 | ExplicitHeight = 25 258 | end 259 | object edtWaitPoll: TSpinEdit 260 | AlignWithMargins = True 261 | Left = 245 262 | Top = 37 263 | Width = 90 264 | Height = 36 265 | Align = alClient 266 | MaxValue = 200 267 | MinValue = 25 268 | TabOrder = 0 269 | Value = 25 270 | OnChange = edtWaitPollChange 271 | end 272 | object lblHdrShowDelay: TLabel 273 | Left = 2 274 | Top = 76 275 | Width = 240 276 | Height = 42 277 | Hint = 'Controls delay for showing the Process Manger window.' 278 | Align = alClient 279 | Alignment = taRightJustify 280 | Caption = 'Show Manager Delay (ms)' 281 | Layout = tlCenter 282 | ExplicitLeft = 35 283 | ExplicitWidth = 207 284 | ExplicitHeight = 25 285 | end 286 | object edtShowDelay: TSpinEdit 287 | AlignWithMargins = True 288 | Left = 245 289 | Top = 79 290 | Width = 90 291 | Height = 36 292 | Align = alClient 293 | MaxValue = 1500 294 | MinValue = 100 295 | TabOrder = 1 296 | Value = 200 297 | OnChange = edtShowDelayChange 298 | end 299 | end 300 | object memoMessage: TMemo 301 | Left = 1 302 | Top = 355 303 | Width = 760 304 | Height = 89 305 | Align = alBottom 306 | Anchors = [] 307 | TabOrder = 2 308 | end 309 | end 310 | end 311 | -------------------------------------------------------------------------------- /Source/frmDeputyUpdates.dfm: -------------------------------------------------------------------------------- 1 | object DeputyUpdates: TDeputyUpdates 2 | Left = 0 3 | Top = 0 4 | Caption = 'Deputy Updates' 5 | ClientHeight = 424 6 | ClientWidth = 618 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -12 11 | Font.Name = 'Segoe UI' 12 | Font.Style = [] 13 | OnCreate = FormCreate 14 | OnDestroy = FormDestroy 15 | TextHeight = 15 16 | object gpUpdates: TGridPanel 17 | Left = 0 18 | Top = 0 19 | Width = 618 20 | Height = 196 21 | Align = alTop 22 | Caption = 'gpUpdates' 23 | ColumnCollection = < 24 | item 25 | SizeStyle = ssAbsolute 26 | Value = 96.000000000000000000 27 | end 28 | item 29 | SizeStyle = ssAbsolute 30 | Value = 220.000000000000000000 31 | end 32 | item 33 | SizeStyle = ssAbsolute 34 | Value = 164.000000000000000000 35 | end 36 | item 37 | Value = 100.000000000000000000 38 | end> 39 | ControlCollection = < 40 | item 41 | Column = 0 42 | Control = lblHdrItem 43 | Row = 0 44 | end 45 | item 46 | Column = 1 47 | Control = lblHdrVerCurr 48 | Row = 0 49 | end 50 | item 51 | Column = 3 52 | Control = lblHdrUpdate 53 | Row = 0 54 | end 55 | item 56 | Column = 2 57 | Control = lblHdrVerAvail 58 | Row = 0 59 | end 60 | item 61 | Column = 0 62 | Control = lblDeputy 63 | Row = 1 64 | end 65 | item 66 | Column = 0 67 | Control = lblCaddie 68 | Row = 2 69 | end 70 | item 71 | Column = 0 72 | Control = lblDemoFMX 73 | Row = 3 74 | end 75 | item 76 | Column = 0 77 | Control = lblDemoVCL 78 | Row = 4 79 | end 80 | item 81 | Column = 1 82 | Control = lblDeputyInst 83 | Row = 1 84 | end 85 | item 86 | Column = 2 87 | Control = lblDeputyAvail 88 | Row = 1 89 | end 90 | item 91 | Column = 3 92 | Control = btnUpdateDeputy 93 | Row = 1 94 | end 95 | item 96 | Column = 1 97 | Control = lblCaddieInst 98 | Row = 2 99 | end 100 | item 101 | Column = 2 102 | Control = lblCaddieAvail 103 | Row = 2 104 | end 105 | item 106 | Column = 3 107 | Control = btnUpdateCaddie 108 | Row = 2 109 | end 110 | item 111 | Column = 1 112 | Control = lblDemoFmxInst 113 | Row = 3 114 | end 115 | item 116 | Column = 2 117 | Control = lblDemoFMXAvail 118 | Row = 3 119 | end 120 | item 121 | Column = 3 122 | Control = btnUpdateDemoFMX 123 | Row = 3 124 | end 125 | item 126 | Column = 1 127 | Control = lblDemoVCLInst 128 | Row = 4 129 | end 130 | item 131 | Column = 2 132 | Control = lblDemoVCLAvail 133 | Row = 4 134 | end 135 | item 136 | Column = 3 137 | Control = btnUpdateDemoVCL 138 | Row = 4 139 | end 140 | item 141 | Column = 0 142 | Control = lblHdrUpdateRefresh 143 | Row = 5 144 | end 145 | item 146 | Column = 1 147 | Control = lblUpdateRefresh 148 | Row = 5 149 | end> 150 | RowCollection = < 151 | item 152 | SizeStyle = ssAbsolute 153 | Value = 24.000000000000000000 154 | end 155 | item 156 | Value = 16.446296828550970000 157 | end 158 | item 159 | Value = 16.614285885756040000 160 | end 161 | item 162 | Value = 16.924303900295690000 163 | end 164 | item 165 | Value = 16.717808507005190000 166 | end 167 | item 168 | Value = 33.297304878392110000 169 | end> 170 | ShowCaption = False 171 | TabOrder = 0 172 | object lblHdrItem: TLabel 173 | Left = 1 174 | Top = 1 175 | Width = 96 176 | Height = 24 177 | Align = alClient 178 | Alignment = taCenter 179 | Caption = 'Item' 180 | ExplicitWidth = 24 181 | ExplicitHeight = 15 182 | end 183 | object lblHdrVerCurr: TLabel 184 | Left = 97 185 | Top = 1 186 | Width = 220 187 | Height = 24 188 | Align = alClient 189 | Alignment = taCenter 190 | Caption = 'Current Version' 191 | ExplicitWidth = 81 192 | ExplicitHeight = 15 193 | end 194 | object lblHdrUpdate: TLabel 195 | Left = 481 196 | Top = 1 197 | Width = 136 198 | Height = 24 199 | Align = alClient 200 | Alignment = taCenter 201 | Caption = 'Update' 202 | ExplicitWidth = 38 203 | ExplicitHeight = 15 204 | end 205 | object lblHdrVerAvail: TLabel 206 | Left = 317 207 | Top = 1 208 | Width = 164 209 | Height = 24 210 | Align = alClient 211 | Alignment = taCenter 212 | Caption = 'Available Version' 213 | ExplicitWidth = 89 214 | ExplicitHeight = 15 215 | end 216 | object lblDeputy: TLabel 217 | Left = 1 218 | Top = 25 219 | Width = 96 220 | Height = 28 221 | Align = alClient 222 | Alignment = taCenter 223 | Caption = 'Deputy' 224 | ExplicitWidth = 38 225 | ExplicitHeight = 15 226 | end 227 | object lblCaddie: TLabel 228 | Left = 1 229 | Top = 53 230 | Width = 96 231 | Height = 28 232 | Align = alClient 233 | Alignment = taCenter 234 | Caption = 'Caddie' 235 | ExplicitWidth = 37 236 | ExplicitHeight = 15 237 | end 238 | object lblDemoFMX: TLabel 239 | Left = 1 240 | Top = 81 241 | Width = 96 242 | Height = 29 243 | Align = alClient 244 | Alignment = taCenter 245 | Caption = 'FMX Demo' 246 | ExplicitWidth = 59 247 | ExplicitHeight = 15 248 | end 249 | object lblDemoVCL: TLabel 250 | Left = 1 251 | Top = 110 252 | Width = 96 253 | Height = 28 254 | Align = alClient 255 | Alignment = taCenter 256 | Caption = 'VCL Demo' 257 | ExplicitWidth = 56 258 | ExplicitHeight = 15 259 | end 260 | object lblDeputyInst: TLabel 261 | Left = 97 262 | Top = 25 263 | Width = 220 264 | Height = 28 265 | Align = alClient 266 | Alignment = taCenter 267 | Caption = 'DeputyInst' 268 | ExplicitWidth = 57 269 | ExplicitHeight = 15 270 | end 271 | object lblDeputyAvail: TLabel 272 | Left = 317 273 | Top = 25 274 | Width = 164 275 | Height = 28 276 | Align = alClient 277 | Alignment = taCenter 278 | Caption = 'deputyavail' 279 | ExplicitWidth = 61 280 | ExplicitHeight = 15 281 | end 282 | object btnUpdateDeputy: TButton 283 | AlignWithMargins = True 284 | Left = 484 285 | Top = 28 286 | Width = 130 287 | Height = 22 288 | Align = alClient 289 | Caption = 'Update Deputy' 290 | TabOrder = 0 291 | OnClick = btnUpdateDeputyClick 292 | end 293 | object lblCaddieInst: TLabel 294 | Left = 97 295 | Top = 53 296 | Width = 220 297 | Height = 28 298 | Align = alClient 299 | Alignment = taCenter 300 | Caption = 'caddieInst' 301 | ExplicitWidth = 54 302 | ExplicitHeight = 15 303 | end 304 | object lblCaddieAvail: TLabel 305 | Left = 317 306 | Top = 53 307 | Width = 164 308 | Height = 28 309 | Align = alClient 310 | Alignment = taCenter 311 | Caption = 'CaddieAvail' 312 | ExplicitWidth = 63 313 | ExplicitHeight = 15 314 | end 315 | object btnUpdateCaddie: TButton 316 | AlignWithMargins = True 317 | Left = 484 318 | Top = 56 319 | Width = 130 320 | Height = 22 321 | Align = alClient 322 | Caption = 'Update Caddie' 323 | TabOrder = 1 324 | OnClick = btnUpdateCaddieClick 325 | end 326 | object lblDemoFmxInst: TLabel 327 | Left = 97 328 | Top = 81 329 | Width = 220 330 | Height = 29 331 | Align = alClient 332 | Alignment = taCenter 333 | Caption = 'fmxInst' 334 | ExplicitWidth = 40 335 | ExplicitHeight = 15 336 | end 337 | object lblDemoFMXAvail: TLabel 338 | Left = 317 339 | Top = 81 340 | Width = 164 341 | Height = 29 342 | Align = alClient 343 | Alignment = taCenter 344 | Caption = 'FmxAvail' 345 | ExplicitWidth = 49 346 | ExplicitHeight = 15 347 | end 348 | object btnUpdateDemoFMX: TButton 349 | AlignWithMargins = True 350 | Left = 484 351 | Top = 84 352 | Width = 130 353 | Height = 23 354 | Align = alClient 355 | Caption = 'Update FMX Demo' 356 | TabOrder = 2 357 | OnClick = btnUpdateDemoFMXClick 358 | end 359 | object lblDemoVCLInst: TLabel 360 | Left = 97 361 | Top = 110 362 | Width = 220 363 | Height = 28 364 | Align = alClient 365 | Alignment = taCenter 366 | Caption = 'vclInst' 367 | ExplicitWidth = 34 368 | ExplicitHeight = 15 369 | end 370 | object lblDemoVCLAvail: TLabel 371 | Left = 317 372 | Top = 110 373 | Width = 164 374 | Height = 28 375 | Align = alClient 376 | Alignment = taCenter 377 | Caption = 'vclAvail' 378 | ExplicitWidth = 41 379 | ExplicitHeight = 15 380 | end 381 | object btnUpdateDemoVCL: TButton 382 | AlignWithMargins = True 383 | Left = 484 384 | Top = 113 385 | Width = 130 386 | Height = 22 387 | Align = alClient 388 | Caption = 'Update VCL Demo' 389 | TabOrder = 3 390 | OnClick = btnUpdateDemoVCLClick 391 | end 392 | object lblHdrUpdateRefresh: TLabel 393 | Left = 1 394 | Top = 138 395 | Width = 96 396 | Height = 57 397 | Align = alClient 398 | Alignment = taCenter 399 | Caption = 'Updates Refreshed' 400 | WordWrap = True 401 | ExplicitWidth = 52 402 | ExplicitHeight = 30 403 | end 404 | object lblUpdateRefresh: TLabel 405 | Left = 97 406 | Top = 138 407 | Width = 220 408 | Height = 57 409 | Align = alClient 410 | Alignment = taCenter 411 | Caption = '00:00:00' 412 | ExplicitWidth = 42 413 | ExplicitHeight = 15 414 | end 415 | end 416 | object memoMessages: TMemo 417 | Left = 0 418 | Top = 196 419 | Width = 618 420 | Height = 228 421 | Align = alClient 422 | Lines.Strings = ( 423 | 'Memo1') 424 | TabOrder = 1 425 | end 426 | end 427 | -------------------------------------------------------------------------------- /Source/frmDeputyUpdates.pas: -------------------------------------------------------------------------------- 1 | unit frmDeputyUpdates; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.Menus, 8 | SERTTK.DeputyTypes, SE.UpdateManager; 9 | 10 | const 11 | MAJ_VER = 1; // Major version nr. 12 | MIN_VER = 0; // Minor version nr. 13 | REL_VER = 0; // Release nr. 14 | BLD_VER = 0; // Build nr. 15 | 16 | // Version history 17 | // v1.0.0.0 : First Release 18 | 19 | { ******************************************************************** } 20 | { written by swiftexpat } 21 | { copyright 2022 } 22 | { Email : support@swiftexpat.com } 23 | { Web : https://swiftexpat.com } 24 | { } 25 | { The source code is given as is. The author is not responsible } 26 | { for any possible damage done due to the use of this code. } 27 | { The complete source code remains property of the author and may } 28 | { not be distributed, published, given or sold in any form as such. } 29 | { No parts of the source code can be included in any other component } 30 | { or application without written authorization of the author. } 31 | { ******************************************************************** } 32 | 33 | type 34 | TDeputyUpdates = class(TForm) 35 | gpUpdates: TGridPanel; 36 | lblHdrItem: TLabel; 37 | lblHdrVerCurr: TLabel; 38 | lblHdrUpdate: TLabel; 39 | memoMessages: TMemo; 40 | lblHdrVerAvail: TLabel; 41 | lblDeputy: TLabel; 42 | lblCaddie: TLabel; 43 | lblDemoFMX: TLabel; 44 | lblDemoVCL: TLabel; 45 | lblDeputyInst: TLabel; 46 | lblDeputyAvail: TLabel; 47 | btnUpdateDeputy: TButton; 48 | lblCaddieInst: TLabel; 49 | lblCaddieAvail: TLabel; 50 | btnUpdateCaddie: TButton; 51 | lblDemoFmxInst: TLabel; 52 | lblDemoFMXAvail: TLabel; 53 | btnUpdateDemoFMX: TButton; 54 | lblDemoVCLInst: TLabel; 55 | lblDemoVCLAvail: TLabel; 56 | btnUpdateDemoVCL: TButton; 57 | lblHdrUpdateRefresh: TLabel; 58 | lblUpdateRefresh: TLabel; 59 | procedure btnUpdateDemoFMXClick(Sender: TObject); 60 | procedure btnUpdateDemoVCLClick(Sender: TObject); 61 | procedure btnUpdateCaddieClick(Sender: TObject); 62 | procedure btnUpdateDeputyClick(Sender: TObject); 63 | procedure FormCreate(Sender: TObject); 64 | procedure FormDestroy(Sender: TObject); 65 | private 66 | FDeputyUpdate: TSERTTKAppVersionUpdate; 67 | FUrlCacheMgr: TSEUrlCacheManager; 68 | FSettings: TSERTTKDeputySettings; 69 | FDeputyUtils: TSERTTKDeputyUtils; 70 | FMiCaddie, FMiDemoFMX, FMiDemoVCL: TMenuItem; 71 | FLicensed: boolean; 72 | procedure DownloadDoneCaddie(AMessage: string; ACacheEntry: TSEUrlCacheEntry); 73 | procedure DownloadDoneDemoFMX(AMessage: string; ACacheEntry: TSEUrlCacheEntry); 74 | procedure DownloadDoneDemoVCL(AMessage: string; ACacheEntry: TSEUrlCacheEntry); 75 | procedure RefreshCaddie; 76 | procedure RefreshDemoFMX; 77 | procedure RefreshDemoVCL; 78 | procedure SaveCacheMgr; 79 | procedure OnVersionUpdateMessage(const AMessage: string); 80 | procedure LogMessage(AMessage: string); 81 | procedure UpdateLastRefresh; 82 | procedure OnDeputyVersionRefreshed(const AMessage: string); 83 | public 84 | procedure ExpertUpdatesRefresh(ALicensed: boolean); 85 | procedure AssignSettings(ASettings: TSERTTKDeputySettings); 86 | procedure AssignAppUpdate(const AAppUpdate: TSERTTKAppVersionUpdate); 87 | procedure AssignMenuItems(AMiCaddie, AMiDemoFMX, AMiDemoVCL: TMenuItem); 88 | end; 89 | 90 | EDeputyUpdatesCreate = class(Exception); 91 | 92 | TDeputyUpdatesFactory = class 93 | public 94 | class function DeputyUpdates: TDeputyUpdates; 95 | class function ShowDeputyUpdates: TDeputyUpdates; 96 | class procedure HideDeputyUpdates; 97 | end; 98 | 99 | var 100 | DeputyUpdates: TDeputyUpdates; 101 | 102 | implementation 103 | 104 | const 105 | fmt_datetime = 'mmm-dd-yyyy hh:nn:ss'; 106 | 107 | {$R *.dfm} 108 | { TDeputyUpdates } 109 | 110 | procedure TDeputyUpdates.AssignAppUpdate(const AAppUpdate: TSERTTKAppVersionUpdate); 111 | begin 112 | FDeputyUpdate := AAppUpdate; 113 | FUrlCacheMgr.UserAgent(FDeputyUpdate.WizardInfo.AgentString); 114 | end; 115 | 116 | procedure TDeputyUpdates.AssignMenuItems(AMiCaddie, AMiDemoFMX, AMiDemoVCL: TMenuItem); 117 | begin 118 | FMiCaddie := AMiCaddie; 119 | FMiDemoFMX := AMiDemoFMX; 120 | FMiDemoVCL := AMiDemoVCL; 121 | end; 122 | 123 | procedure TDeputyUpdates.AssignSettings(ASettings: TSERTTKDeputySettings); 124 | begin 125 | FSettings := ASettings; 126 | end; 127 | 128 | procedure TDeputyUpdates.btnUpdateCaddieClick(Sender: TObject); 129 | var 130 | ce: TSEUrlCacheEntry; 131 | begin 132 | ce := FUrlCacheMgr.CacheByUrl(FDeputyUtils.url_caddie_download); 133 | if ce.CacheValid and FDeputyUtils.CaddieAppExists then 134 | begin 135 | FDeputyUtils.RunCaddie 136 | end 137 | else 138 | RefreshCaddie; 139 | end; 140 | 141 | procedure TDeputyUpdates.btnUpdateDemoFMXClick(Sender: TObject); 142 | var 143 | ce: TSEUrlCacheEntry; 144 | begin 145 | ce := FUrlCacheMgr.CacheByUrl(FDeputyUtils.url_demo_fmx_download); 146 | if ce.CacheValid and FDeputyUtils.DemoFMXExists then 147 | begin 148 | FDeputyUtils.RunDemoFMX 149 | end 150 | else 151 | RefreshDemoFMX; 152 | end; 153 | 154 | procedure TDeputyUpdates.btnUpdateDemoVCLClick(Sender: TObject); 155 | var 156 | ce: TSEUrlCacheEntry; 157 | begin 158 | ce := FUrlCacheMgr.CacheByUrl(FDeputyUtils.url_demo_vcl_download); 159 | if ce.CacheValid and FDeputyUtils.DemoVCLExists then 160 | begin 161 | FDeputyUtils.RunDemoVCL 162 | end 163 | else 164 | RefreshDemoVCL; 165 | end; 166 | 167 | procedure TDeputyUpdates.btnUpdateDeputyClick(Sender: TObject); 168 | begin 169 | FDeputyUpdate.UpdateDeputyExpert 170 | end; 171 | 172 | procedure TDeputyUpdates.DownloadDoneCaddie(AMessage: string; ACacheEntry: TSEUrlCacheEntry); 173 | begin 174 | TThread.Queue(nil, 175 | procedure 176 | begin 177 | if FDeputyUtils.CaddieAppExists then 178 | begin 179 | FMiCaddie.Caption := 'Run Caddie'; 180 | lblCaddieInst.Caption := FormatDateTime(fmt_datetime,ACacheEntry.LastModifiedDTS); 181 | end; 182 | btnUpdateCaddie.Caption := 'Run Caddie or refresh'; 183 | UpdateLastRefresh; 184 | end); 185 | end; 186 | 187 | procedure TDeputyUpdates.DownloadDoneDemoFMX(AMessage: string; ACacheEntry: TSEUrlCacheEntry); 188 | begin 189 | TThread.Queue(nil, 190 | procedure 191 | begin 192 | if FDeputyUtils.DemoFMXExists then 193 | begin 194 | FMiDemoFMX.Caption := 'Run Demo FMX'; 195 | lblDemoFmxInst.Caption := FormatDateTime(fmt_datetime,ACacheEntry.LastModifiedDTS); 196 | end; 197 | btnUpdateDemoFMX.Caption := 'Run Demo FMX or refresh'; 198 | UpdateLastRefresh; 199 | end); 200 | end; 201 | 202 | procedure TDeputyUpdates.DownloadDoneDemoVCL(AMessage: string; ACacheEntry: TSEUrlCacheEntry); 203 | begin 204 | TThread.Queue(nil, 205 | procedure 206 | begin 207 | if FDeputyUtils.DemoVCLExists then 208 | begin 209 | FMiDemoVCL.Caption := 'Run DemoVCL'; 210 | lblDemoVCLInst.Caption := FormatDateTime(fmt_datetime,ACacheEntry.LastModifiedDTS); 211 | end; 212 | btnUpdateDemoVCL.Caption := 'Run Demo VCL or refresh'; 213 | UpdateLastRefresh; 214 | end); 215 | end; 216 | 217 | procedure TDeputyUpdates.ExpertUpdatesRefresh(ALicensed: boolean); 218 | begin 219 | FLicensed := ALicensed; 220 | FUrlCacheMgr.JsonString := FSettings.UrlCacheJson; 221 | if FLicensed then 222 | OnDeputyVersionRefreshed('Licensed') 223 | else 224 | begin 225 | FDeputyUpdate.OnMessage := OnVersionUpdateMessage; 226 | FDeputyUpdate.OnDeputyUpdatesRefreshed := OnDeputyVersionRefreshed; 227 | FDeputyUpdate.ExpertUpdatesRefresh(); 228 | end; 229 | RefreshDemoFMX; 230 | RefreshDemoVCL; 231 | RefreshCaddie; 232 | end; 233 | 234 | procedure TDeputyUpdates.FormCreate(Sender: TObject); 235 | begin 236 | FDeputyUtils := TSERTTKDeputyUtils.Create; 237 | FUrlCacheMgr := TSEUrlCacheManager.Create; 238 | self.Caption := self.Caption + ' v'+Maj_Ver.ToString + '.'+Min_Ver.ToString + '.'+Rel_Ver.ToString; 239 | FUrlCacheMgr.OnManagerMessage := LogMessage; 240 | memoMessages.Clear; 241 | end; 242 | 243 | procedure TDeputyUpdates.FormDestroy(Sender: TObject); 244 | begin 245 | FUrlCacheMgr.Free; 246 | FDeputyUtils.Free; 247 | end; 248 | 249 | procedure TDeputyUpdates.LogMessage(AMessage: string); 250 | var 251 | msg: string; 252 | begin 253 | msg := 'Msg: ' + AMessage; 254 | TThread.Queue(nil, 255 | procedure 256 | begin 257 | memoMessages.Lines.Add(msg); 258 | end); 259 | end; 260 | 261 | procedure TDeputyUpdates.OnDeputyVersionRefreshed(const AMessage: string); 262 | begin 263 | memoMessages.Lines.Add('deputy refreshed: ' + AMessage); 264 | lblDeputyInst.Caption := FDeputyUpdate.WizardVersion.VersionString; 265 | if FLicensed then 266 | begin 267 | btnUpdateDeputy.Enabled := false; 268 | lblDeputyAvail.Caption := 'Use Caddie'; 269 | end 270 | else 271 | begin 272 | lblDeputyAvail.Caption := FDeputyUpdate.UpdateVersion.VersionString; 273 | btnUpdateDeputy.Enabled := FDeputyUpdate.ExpertUpdateAvailable; 274 | btnUpdateDeputy.Caption := FDeputyUpdate.UpdateExpertButtonText; 275 | end; 276 | end; 277 | 278 | procedure TDeputyUpdates.OnVersionUpdateMessage(const AMessage: string); 279 | begin 280 | memoMessages.Lines.Add(AMessage) 281 | end; 282 | 283 | procedure TDeputyUpdates.RefreshCaddie; 284 | var 285 | ce: TSEUrlCacheEntry; 286 | begin 287 | ce := FUrlCacheMgr.CacheByUrl(FDeputyUtils.url_caddie_download); 288 | ce.OnRefreshDone := DownloadDoneCaddie; 289 | ce.LocalPath := FDeputyUtils.CaddieDownloadFile; 290 | ce.ExtractPath := FDeputyUtils.RttkAppFolder; 291 | ce.ExtractZip := true; 292 | ce.OnRequestMessage := LogMessage; 293 | lblCaddieInst.Caption := FormatDateTime(fmt_datetime,ce.LastModifiedDTS); 294 | ce.RefreshCache; 295 | end; 296 | 297 | procedure TDeputyUpdates.RefreshDemoFMX; 298 | var 299 | ce: TSEUrlCacheEntry; 300 | begin 301 | ce := FUrlCacheMgr.CacheByUrl(FDeputyUtils.url_demo_fmx_download); 302 | ce.OnRefreshDone := DownloadDoneDemoFMX; 303 | ce.LocalPath := FDeputyUtils.DemoDownloadFMXFile; 304 | ce.ExtractPath := FDeputyUtils.RttkAppFolder; 305 | ce.ExtractZip := true; 306 | ce.OnRequestMessage := LogMessage; 307 | lblDemoFmxInst.Caption := FormatDateTime(fmt_datetime,ce.LastModifiedDTS);; 308 | ce.RefreshCache; 309 | end; 310 | 311 | procedure TDeputyUpdates.RefreshDemoVCL; 312 | var 313 | ce: TSEUrlCacheEntry; 314 | begin 315 | ce := FUrlCacheMgr.CacheByUrl(FDeputyUtils.url_demo_vcl_download); 316 | ce.OnRefreshDone := DownloadDoneDemoVCL; 317 | ce.LocalPath := FDeputyUtils.DemoDownloadVCLFile; 318 | ce.ExtractPath := FDeputyUtils.RttkAppFolder; 319 | ce.ExtractZip := true; 320 | ce.OnRequestMessage := LogMessage; 321 | lblDemoVCLInst.Caption := FormatDateTime(fmt_datetime,ce.LastModifiedDTS);; 322 | ce.RefreshCache; 323 | end; 324 | 325 | procedure TDeputyUpdates.SaveCacheMgr; 326 | begin 327 | FSettings.UrlCacheJson := FUrlCacheMgr.JsonString; 328 | end; 329 | 330 | procedure TDeputyUpdates.UpdateLastRefresh; 331 | begin 332 | TThread.Synchronize(nil, 333 | procedure 334 | begin 335 | lblUpdateRefresh.Caption := FormatDateTime(fmt_datetime, now); 336 | SaveCacheMgr; 337 | end); 338 | end; 339 | 340 | { TDeputyUpdatesFactory } 341 | 342 | class function TDeputyUpdatesFactory.DeputyUpdates: TDeputyUpdates; 343 | var 344 | i: integer; 345 | begin 346 | for i := 0 to Screen.FormCount - 1 do // itterate the screens 347 | if Screen.Forms[i].ClassType = TDeputyUpdates then 348 | begin 349 | result := TDeputyUpdates(Screen.Forms[i]); 350 | if Screen.Forms[i].WindowState = TWindowState.wsMinimized then 351 | Screen.Forms[i].WindowState := TWindowState.wsNormal; 352 | exit; 353 | end; 354 | result := nil; 355 | try 356 | result := TDeputyUpdates.Create(Application); 357 | except // handle anything that does not let our form show up 358 | on E: Exception do 359 | begin 360 | if Assigned(result) then 361 | result.Free; 362 | raise EDeputyUpdatesCreate.Create('Create failed Deputy Updates form'); 363 | end; 364 | end; 365 | end; 366 | 367 | class procedure TDeputyUpdatesFactory.HideDeputyUpdates; 368 | begin 369 | DeputyUpdates.Hide; 370 | end; 371 | 372 | class function TDeputyUpdatesFactory.ShowDeputyUpdates: TDeputyUpdates; 373 | begin 374 | result := DeputyUpdates; 375 | result.Show; 376 | end; 377 | 378 | end. 379 | -------------------------------------------------------------------------------- /Source/frmDeputyProcMgr.pas: -------------------------------------------------------------------------------- 1 | unit frmDeputyProcMgr; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls, SE.ProcMgrUtils, SERTTK.DeputyTypes, 8 | Vcl.CategoryButtons, Vcl.ExtCtrls, Generics.Collections, System.Diagnostics, Vcl.Mask, Vcl.Samples.Spin; 9 | 10 | const 11 | MAJ_VER = 1; // Major version nr. 12 | MIN_VER = 1; // Minor version nr. 13 | REL_VER = 0; // Release nr. 14 | BLD_VER = 0; // Build nr. 15 | 16 | // Version history 17 | // v1.0.0.0 : First Release 18 | // v1.1.0.0 : Moved Settings to dedicated frame on options 19 | 20 | { ******************************************************************** } 21 | { written by swiftexpat } 22 | { copyright 2022 } 23 | { Email : support@swiftexpat.com } 24 | { Web : https://swiftexpat.com } 25 | { } 26 | { The source code is given as is. The author is not responsible } 27 | { for any possible damage done due to the use of this code. } 28 | { The complete source code remains property of the author and may } 29 | { not be distributed, published, given or sold in any form as such. } 30 | { No parts of the source code can be included in any other component } 31 | { or application without written authorization of the author. } 32 | { ******************************************************************** } 33 | 34 | type 35 | EDeputyProcMgrCreate = class(Exception); 36 | 37 | TDeputyProcMgr = class(TForm) 38 | memoLeakStatus: TMemo; 39 | sbMain: TStatusBar; 40 | lbMgrStatus: TListBox; 41 | pcWorkarea: TPageControl; 42 | tsStatus: TTabSheet; 43 | btnAbortCleanup: TButton; 44 | btnForceTerminate: TButton; 45 | tmrCleanupStatus: TTimer; 46 | gpCleanStatus: TGridPanel; 47 | lblHdrLoopCount: TLabel; 48 | lblLoopCount: TLabel; 49 | lblHdrElapsed: TLabel; 50 | lblElapsedMS: TLabel; 51 | tsHistory: TTabSheet; 52 | lvHist: TListView; 53 | memoLeakHist: TMemo; 54 | procedure FormCreate(Sender: TObject); 55 | procedure FormDestroy(Sender: TObject); 56 | procedure FormClose(Sender: TObject; var Action: TCloseAction); 57 | procedure btnAbortCleanupClick(Sender: TObject); 58 | procedure btnForceTerminateClick(Sender: TObject); 59 | procedure tmrCleanupStatusTimer(Sender: TObject); 60 | procedure FormShow(Sender: TObject); 61 | procedure lvHistInfoTip(Sender: TObject; Item: TListItem; var InfoTip: string); 62 | procedure lvHistSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean); 63 | strict private 64 | FProcCleanup: TSEProcessCleanup; 65 | // FProcMgrInfo: TSEProcessManagerEnvInfo; 66 | FCleanups: TObjectList; 67 | FProcMgr: TSEProcessManager; 68 | FStopWatch: TStopWatch; 69 | FSettings: TSERTTKDeputySettings; 70 | FStopCommand: TSEProcessStopCommand; 71 | procedure ClearLog; 72 | procedure ClearMemLeak; 73 | function AddCleanup(const AProcName: string; const AProcDirectory: string): TSEProcessCleanup; 74 | procedure StatusBarUpdateMessage(AMsg: string); 75 | procedure StartCleanupStatus; 76 | procedure StopCleanupStatus; 77 | private 78 | procedure LogMsg(AMessage: string); 79 | procedure LeakCopied(AMessage: string; APID: cardinal); 80 | procedure WaitPoll(APollCount: integer; ALoopTime: integer); 81 | property ProcCleanup: TSEProcessCleanup read FProcCleanup write FProcCleanup; 82 | // property ProcMgrInfo: TSEProcessManagerEnvInfo read FProcMgrInfo write FProcMgrInfo; 83 | procedure UpdateCleanHist(AProcCleanup: TSEProcessCleanup); 84 | public 85 | /// 86 | /// Returns C:\Users\%USERNAME%\AppData\Local\Programs\RunTime_ToolKit\RT_Caddie.exe 87 | /// 88 | /// 89 | /// uses RttkAppFolder C:\Users\%USERNAME%\AppData\Local\Programs\RunTime_ToolKit 90 | /// 91 | function ClearProcess(const AProcName: string; const AProcDirectory: string): Boolean; 92 | /// 93 | /// Called before IDE Compile 94 | /// 95 | /// 96 | /// return false to contine, ture to cancel 97 | /// 98 | function CompileContinue(const AProcFullPath: string): Boolean; 99 | /// 100 | /// Called by the IDE Debug launch 101 | /// 102 | /// 103 | /// return true to continue, false to cancel 104 | /// 105 | function DebugLaunch(const AProcFullPath: string): Boolean; 106 | procedure AssignSettings(ASettings: TSERTTKDeputySettings); 107 | procedure ShowManager; 108 | end; 109 | 110 | TDeputyProcMgrFactory = class 111 | public 112 | class function DeputyProcMgr: TDeputyProcMgr; 113 | class procedure ShowProcMgr; 114 | class procedure HideProcMgr; 115 | end; 116 | 117 | implementation 118 | 119 | {$R *.dfm} 120 | 121 | uses DateUtils; 122 | { TDeputyProcMgr } 123 | 124 | function TDeputyProcMgr.AddCleanup(const AProcName, AProcDirectory: string): TSEProcessCleanup; 125 | var 126 | tli: TListItem; 127 | begin 128 | FStopCommand := TSEProcessStopCommand(FSettings.StopCommand); 129 | result := TSEProcessCleanup.Create(AProcName, AProcDirectory, FStopCommand); 130 | result.OptionsSet(FStopCommand, FSettings.CloseLeakWindow, FSettings.CopyLeakMessage); 131 | FCleanups.Add(result); 132 | tli := TListItem.Create(lvHist.Items); 133 | lvHist.Items.AddItem(tli, 0); 134 | tli.Data := result; 135 | tli.Caption := AProcName; 136 | tli.SubItems.Add(FormatDateTime('hh:nn:ss.zzz', result.StartTime)); 137 | lvHist.Tag := tli.Index; 138 | end; 139 | 140 | procedure TDeputyProcMgr.AssignSettings(ASettings: TSERTTKDeputySettings); 141 | begin 142 | FSettings := ASettings; 143 | FProcMgr.ProcMgrInfo.WaitPollms := FSettings.WaitPollInterval; 144 | end; 145 | 146 | procedure TDeputyProcMgr.btnAbortCleanupClick(Sender: TObject); 147 | begin 148 | FProcMgr.CleanupAbort; 149 | end; 150 | 151 | procedure TDeputyProcMgr.btnForceTerminateClick(Sender: TObject); 152 | begin 153 | FProcMgr.CleanupForceTerminate; 154 | end; 155 | 156 | function TDeputyProcMgr.ClearProcess(const AProcName: string; const AProcDirectory: string): Boolean; 157 | begin 158 | try 159 | ProcCleanup := AddCleanup(AProcName, AProcDirectory); 160 | ClearMemLeak; 161 | ClearLog; 162 | FProcMgr.AssignProcCleanup(ProcCleanup); 163 | // if ProcCleanup.StopCommand = TSEProcessStopCommand.tseProcStopClose then 164 | // self.Show; 165 | StartCleanupStatus; // timer to count with the stopwatch 166 | result := FProcMgr.ProcessCleanup; 167 | tmrCleanupStatus.Enabled := false; // stop the timer 168 | UpdateCleanHist(ProcCleanup); 169 | StopCleanupStatus; 170 | finally 171 | tmrCleanupStatus.Enabled := false; 172 | self.Hide; // hide the form 173 | end; 174 | end; 175 | 176 | // ide is asking if ACancel 177 | // return false to contine, ture to cancel 178 | function TDeputyProcMgr.CompileContinue(const AProcFullPath: string): Boolean; 179 | var 180 | fn, fd: string; 181 | begin 182 | result := FProcMgr.ProcFileExists(AProcFullPath, fn, fd); 183 | if not result then // exit false, IDE continue if the file does not exist 184 | exit(false); 185 | 186 | ClearProcess(fn, fd); 187 | result := false; 188 | end; 189 | 190 | // return true to continue, false to cancel 191 | function TDeputyProcMgr.DebugLaunch(const AProcFullPath: string): Boolean; 192 | var 193 | fn, fd: string; 194 | begin 195 | result := FProcMgr.ProcFileExists(AProcFullPath, fn, fd); 196 | if not result then // exit true, IDE continue if the file does not exist 197 | exit(true); 198 | 199 | ClearProcess(fn, fd); 200 | result := true; 201 | end; 202 | 203 | procedure TDeputyProcMgr.ClearLog; 204 | begin 205 | lbMgrStatus.Clear; 206 | end; 207 | 208 | procedure TDeputyProcMgr.ClearMemLeak; 209 | begin 210 | memoLeakStatus.Lines.Clear; 211 | end; 212 | 213 | procedure TDeputyProcMgr.FormClose(Sender: TObject; var Action: TCloseAction); 214 | begin 215 | // FProcMgr.StopManager; 216 | end; 217 | 218 | procedure TDeputyProcMgr.FormCreate(Sender: TObject); 219 | begin 220 | FCleanups := TObjectList.Create(true); 221 | FProcMgr := TSEProcessManager.Create; 222 | FProcMgr.OnMessage := LogMsg; 223 | FProcMgr.OnLeakCopied := LeakCopied; 224 | FProcMgr.OnWaitPoll := WaitPoll; 225 | self.Caption := self.Caption + ' v'+Maj_Ver.ToString + '.'+Min_Ver.ToString + '.'+Rel_Ver.ToString; 226 | end; 227 | 228 | procedure TDeputyProcMgr.FormDestroy(Sender: TObject); 229 | begin 230 | FProcMgr.Free; 231 | FCleanups.Free; 232 | end; 233 | 234 | procedure TDeputyProcMgr.FormShow(Sender: TObject); 235 | begin 236 | pcWorkarea.ActivePage := tsStatus; 237 | end; 238 | 239 | procedure TDeputyProcMgr.LeakCopied(AMessage: string; APID: cardinal); 240 | begin 241 | ClearMemLeak; 242 | Application.ProcessMessages; 243 | PostMessage(memoLeakStatus.Handle, WM_Paste, 0, 0); 244 | TThread.Sleep(5); // a few ms to paste 245 | Application.ProcessMessages; 246 | TThread.Sleep(5); // a few ms to paste 247 | if memoLeakStatus.Lines.Text.IndexOf('leak') > -1 then 248 | ProcCleanup.SetLeakByPID(APID, memoLeakStatus.Lines.Text); 249 | end; 250 | 251 | procedure TDeputyProcMgr.LogMsg(AMessage: string); 252 | begin 253 | lbMgrStatus.Items.Add(AMessage); 254 | Application.ProcessMessages; 255 | end; 256 | 257 | procedure TDeputyProcMgr.lvHistInfoTip(Sender: TObject; Item: TListItem; var InfoTip: string); 258 | var 259 | pc: TSEProcessCleanup; 260 | begin 261 | if Assigned(Item.Data) then // check Item type? 262 | pc := TSEProcessCleanup(Item.Data) 263 | else 264 | exit; 265 | if pc.LeakShown then 266 | InfoTip := 'Leak found'; 267 | end; 268 | 269 | procedure TDeputyProcMgr.lvHistSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean); 270 | var 271 | pc: TSEProcessCleanup; 272 | begin 273 | if Selected and Assigned(Item.Data) then 274 | pc := TSEProcessCleanup(Item.Data) 275 | else 276 | exit; 277 | if memoLeakHist.Tag <> Item.Index then // update the hist box based on selected item index 278 | begin 279 | memoLeakHist.Clear; 280 | if pc.LeakShown then 281 | pc.LeakDetail(memoLeakHist.Lines) 282 | else 283 | memoLeakHist.Lines.Add('No Leak found ' + Item.Index.ToString); 284 | memoLeakHist.Tag := Item.Index; 285 | end; 286 | end; 287 | 288 | procedure TDeputyProcMgr.ShowManager; 289 | begin 290 | self.Show; 291 | pcWorkarea.ActivePage := tsStatus; 292 | end; 293 | 294 | procedure TDeputyProcMgr.StartCleanupStatus; 295 | begin 296 | WaitPoll(0, 0); 297 | FStopWatch := TStopWatch.StartNew; 298 | tmrCleanupStatus.Enabled := true; 299 | gpCleanStatus.Visible := true; 300 | end; 301 | 302 | procedure TDeputyProcMgr.StatusBarUpdateMessage(AMsg: string); 303 | begin 304 | sbMain.Panels[0].Text := AMsg; 305 | end; 306 | 307 | procedure TDeputyProcMgr.StopCleanupStatus; 308 | begin 309 | tmrCleanupStatus.Enabled := false; 310 | gpCleanStatus.Visible := false; 311 | FStopWatch.Stop; 312 | StatusBarUpdateMessage('Process terminated in ' + FStopWatch.ElapsedMilliseconds.ToString + 'ms'); 313 | end; 314 | 315 | procedure TDeputyProcMgr.tmrCleanupStatusTimer(Sender: TObject); 316 | begin 317 | lblElapsedMS.Caption := FStopWatch.ElapsedMilliseconds.ToString; 318 | Application.ProcessMessages; 319 | end; 320 | 321 | procedure TDeputyProcMgr.UpdateCleanHist(AProcCleanup: TSEProcessCleanup); 322 | var 323 | tli: TListItem; 324 | begin 325 | tli := lvHist.Items[lvHist.Tag]; 326 | tli.SubItems.Add(FormatDateTime('hh:nn:ss.zzz', ProcCleanup.EndTime)); 327 | tli.SubItems.Add(FStopWatch.ElapsedMilliseconds.ToString + ' ms'); 328 | tli.SubItems.Add(boolToStr(ProcCleanup.ProcessFound, true)); 329 | tli.SubItems.Add(boolToStr(ProcCleanup.LeakShown, true)); 330 | memoLeakHist.Tag := -1; 331 | end; 332 | 333 | procedure TDeputyProcMgr.WaitPoll(APollCount: integer; ALoopTime: integer); 334 | begin 335 | lblLoopCount.Caption := APollCount.ToString; 336 | if (APollCount > 1) and (ALoopTime > FSettings.ShowWindowDelay) then 337 | self.Show; 338 | // else 339 | // memo1.Lines.Add('Delay show, loop= ' + APollCount.ToString + ' time= '+ ALoopTime.ToString); 340 | Application.ProcessMessages; 341 | end; 342 | 343 | { TDeputyProcMgrFactory } 344 | 345 | // class procedure TDeputyProcMgrFactory.CleanProcess(const AProcName, AProcDirectory: string; 346 | // const AStopCommand: TSEProcessStopCommand); 347 | // var 348 | // frmMgr: TDeputyProcMgr; 349 | // begin 350 | // frmMgr := DeputyProcMgr; 351 | // frmMgr.Show; 352 | // frmMgr.ClearProcess(AProcName, AProcDirectory, AStopCommand); 353 | // end; 354 | 355 | class function TDeputyProcMgrFactory.DeputyProcMgr: TDeputyProcMgr; 356 | var 357 | i: integer; 358 | begin 359 | for i := 0 to Screen.FormCount - 1 do // itterate the screens 360 | if Screen.Forms[i].ClassType = TDeputyProcMgr then 361 | begin 362 | result := TDeputyProcMgr(Screen.Forms[i]); 363 | if Screen.Forms[i].WindowState = TWindowState.wsMinimized then 364 | Screen.Forms[i].WindowState := TWindowState.wsNormal; 365 | exit; 366 | end; 367 | result := nil; 368 | try 369 | result := TDeputyProcMgr.Create(Application); 370 | except // handle anything that does not let our form show up 371 | on E: Exception do 372 | begin 373 | if Assigned(result) then 374 | result.Free; 375 | raise EDeputyProcMgrCreate.Create('Create failed Deputy Proc Manager form'); 376 | end; 377 | end; 378 | end; 379 | 380 | class procedure TDeputyProcMgrFactory.HideProcMgr; 381 | begin 382 | DeputyProcMgr.Hide; 383 | end; 384 | 385 | class procedure TDeputyProcMgrFactory.ShowProcMgr; 386 | begin 387 | DeputyProcMgr.Show; 388 | end; 389 | 390 | end. 391 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /DevTools/LeakTests/ShowLeakMessage.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {64A18A7A-5A3B-4828-8ECE-32D1DBECC01B} 4 | 19.4 5 | VCL 6 | True 7 | Debug 8 | Win32 9 | 1 10 | Application 11 | ShowLeakMessage.dpr 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Cfg_1 34 | true 35 | true 36 | 37 | 38 | true 39 | Base 40 | true 41 | 42 | 43 | true 44 | Cfg_2 45 | true 46 | true 47 | 48 | 49 | .\$(Platform)\$(Config) 50 | .\$(Platform)\$(Config) 51 | false 52 | false 53 | false 54 | false 55 | false 56 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) 57 | $(BDS)\bin\delphi_PROJECTICON.ico 58 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 59 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 60 | ShowLeakMessage 61 | 62 | 63 | soapserver;IndySystem;vclwinx;fmx;vclie;DbxCommonDriver;bindengine;vcldb;IndyIPCommon;VCLRESTComponents;FireDACCommonODBC;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;IndyIPClient;dbxcds;vcledge;vclFireDAC;bindcompvclwinx;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;inetdb;rtl;FireDACMySQLDriver;FireDACSqliteDriver;DbxClientDriver;FireDACADSDriver;RESTComponents;soapmidas;DBXSqliteDriver;vcl;vclactnband;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;dsnapcon;adortl;TeeUI;Tee;DBXMySQLDriver;VclSmp;inet;vclimg;vcltouch;FireDACPgDriver;FireDAC;fmxase;inetdbxpress;xmlrtl;tethering;dbrtl;bindcompvcl;dsnap;fmxdae;TeeDB;CloudService;FireDACMSAccDriver;CustomIPTransport;fmxobj;bindcompvclsmp;ObjectDebugger;FMXTee;soaprtl;vcldsnap;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) 64 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 65 | Debug 66 | true 67 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 68 | 1033 69 | $(BDS)\bin\default_app.manifest 70 | true 71 | 72 | 73 | soapserver;IndySystem;vclwinx;fmx;vclie;DbxCommonDriver;bindengine;vcldb;IndyIPCommon;VCLRESTComponents;FireDACCommonODBC;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;IndyIPClient;dbxcds;vcledge;vclFireDAC;bindcompvclwinx;bindcomp;FireDACCommon;FmxTeeUI;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;inetdb;rtl;FireDACMySQLDriver;FireDACSqliteDriver;DbxClientDriver;FireDACADSDriver;RESTComponents;soapmidas;DBXSqliteDriver;vcl;vclactnband;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;dsnapcon;adortl;TeeUI;Tee;DBXMySQLDriver;VclSmp;inet;vclimg;vcltouch;FireDACPgDriver;FireDAC;fmxase;inetdbxpress;xmlrtl;tethering;dbrtl;bindcompvcl;dsnap;fmxdae;TeeDB;CloudService;FireDACMSAccDriver;CustomIPTransport;fmxobj;bindcompvclsmp;FMXTee;soaprtl;vcldsnap;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) 74 | 75 | 76 | DEBUG;$(DCC_Define) 77 | true 78 | false 79 | true 80 | true 81 | true 82 | true 83 | true 84 | 85 | 86 | false 87 | true 88 | PerMonitorV2 89 | 90 | 91 | false 92 | RELEASE;$(DCC_Define) 93 | 0 94 | 0 95 | 96 | 97 | true 98 | PerMonitorV2 99 | 100 | 101 | 102 | MainSource 103 | 104 | 105 |
LeakLoopTester
106 | dfm 107 |
108 | 109 | Base 110 | 111 | 112 | Cfg_1 113 | Base 114 | 115 | 116 | Cfg_2 117 | Base 118 | 119 |
120 | 121 | Delphi.Personality.12 122 | Application 123 | 124 | 125 | 126 | ShowLeakMessage.dpr 127 | 128 | 129 | 130 | 131 | 132 | ShowLeakMessage.exe 133 | true 134 | 135 | 136 | 137 | 138 | 1 139 | 140 | 141 | Contents\MacOS 142 | 1 143 | 144 | 145 | 0 146 | 147 | 148 | 149 | 150 | classes 151 | 64 152 | 153 | 154 | classes 155 | 64 156 | 157 | 158 | 159 | 160 | res\xml 161 | 1 162 | 163 | 164 | res\xml 165 | 1 166 | 167 | 168 | 169 | 170 | library\lib\armeabi-v7a 171 | 1 172 | 173 | 174 | 175 | 176 | library\lib\armeabi 177 | 1 178 | 179 | 180 | library\lib\armeabi 181 | 1 182 | 183 | 184 | 185 | 186 | library\lib\armeabi-v7a 187 | 1 188 | 189 | 190 | 191 | 192 | library\lib\mips 193 | 1 194 | 195 | 196 | library\lib\mips 197 | 1 198 | 199 | 200 | 201 | 202 | library\lib\armeabi-v7a 203 | 1 204 | 205 | 206 | library\lib\arm64-v8a 207 | 1 208 | 209 | 210 | 211 | 212 | library\lib\armeabi-v7a 213 | 1 214 | 215 | 216 | 217 | 218 | res\drawable 219 | 1 220 | 221 | 222 | res\drawable 223 | 1 224 | 225 | 226 | 227 | 228 | res\values 229 | 1 230 | 231 | 232 | res\values 233 | 1 234 | 235 | 236 | 237 | 238 | res\values-v21 239 | 1 240 | 241 | 242 | res\values-v21 243 | 1 244 | 245 | 246 | 247 | 248 | res\values 249 | 1 250 | 251 | 252 | res\values 253 | 1 254 | 255 | 256 | 257 | 258 | res\drawable 259 | 1 260 | 261 | 262 | res\drawable 263 | 1 264 | 265 | 266 | 267 | 268 | res\drawable-xxhdpi 269 | 1 270 | 271 | 272 | res\drawable-xxhdpi 273 | 1 274 | 275 | 276 | 277 | 278 | res\drawable-xxxhdpi 279 | 1 280 | 281 | 282 | res\drawable-xxxhdpi 283 | 1 284 | 285 | 286 | 287 | 288 | res\drawable-ldpi 289 | 1 290 | 291 | 292 | res\drawable-ldpi 293 | 1 294 | 295 | 296 | 297 | 298 | res\drawable-mdpi 299 | 1 300 | 301 | 302 | res\drawable-mdpi 303 | 1 304 | 305 | 306 | 307 | 308 | res\drawable-hdpi 309 | 1 310 | 311 | 312 | res\drawable-hdpi 313 | 1 314 | 315 | 316 | 317 | 318 | res\drawable-xhdpi 319 | 1 320 | 321 | 322 | res\drawable-xhdpi 323 | 1 324 | 325 | 326 | 327 | 328 | res\drawable-mdpi 329 | 1 330 | 331 | 332 | res\drawable-mdpi 333 | 1 334 | 335 | 336 | 337 | 338 | res\drawable-hdpi 339 | 1 340 | 341 | 342 | res\drawable-hdpi 343 | 1 344 | 345 | 346 | 347 | 348 | res\drawable-xhdpi 349 | 1 350 | 351 | 352 | res\drawable-xhdpi 353 | 1 354 | 355 | 356 | 357 | 358 | res\drawable-xxhdpi 359 | 1 360 | 361 | 362 | res\drawable-xxhdpi 363 | 1 364 | 365 | 366 | 367 | 368 | res\drawable-xxxhdpi 369 | 1 370 | 371 | 372 | res\drawable-xxxhdpi 373 | 1 374 | 375 | 376 | 377 | 378 | res\drawable-small 379 | 1 380 | 381 | 382 | res\drawable-small 383 | 1 384 | 385 | 386 | 387 | 388 | res\drawable-normal 389 | 1 390 | 391 | 392 | res\drawable-normal 393 | 1 394 | 395 | 396 | 397 | 398 | res\drawable-large 399 | 1 400 | 401 | 402 | res\drawable-large 403 | 1 404 | 405 | 406 | 407 | 408 | res\drawable-xlarge 409 | 1 410 | 411 | 412 | res\drawable-xlarge 413 | 1 414 | 415 | 416 | 417 | 418 | res\values 419 | 1 420 | 421 | 422 | res\values 423 | 1 424 | 425 | 426 | 427 | 428 | 1 429 | 430 | 431 | Contents\MacOS 432 | 1 433 | 434 | 435 | 0 436 | 437 | 438 | 439 | 440 | Contents\MacOS 441 | 1 442 | .framework 443 | 444 | 445 | Contents\MacOS 446 | 1 447 | .framework 448 | 449 | 450 | Contents\MacOS 451 | 1 452 | .framework 453 | 454 | 455 | 0 456 | 457 | 458 | 459 | 460 | 1 461 | .dylib 462 | 463 | 464 | 1 465 | .dylib 466 | 467 | 468 | 1 469 | .dylib 470 | 471 | 472 | Contents\MacOS 473 | 1 474 | .dylib 475 | 476 | 477 | Contents\MacOS 478 | 1 479 | .dylib 480 | 481 | 482 | Contents\MacOS 483 | 1 484 | .dylib 485 | 486 | 487 | 0 488 | .dll;.bpl 489 | 490 | 491 | 492 | 493 | 1 494 | .dylib 495 | 496 | 497 | 1 498 | .dylib 499 | 500 | 501 | 1 502 | .dylib 503 | 504 | 505 | Contents\MacOS 506 | 1 507 | .dylib 508 | 509 | 510 | Contents\MacOS 511 | 1 512 | .dylib 513 | 514 | 515 | Contents\MacOS 516 | 1 517 | .dylib 518 | 519 | 520 | 0 521 | .bpl 522 | 523 | 524 | 525 | 526 | 0 527 | 528 | 529 | 0 530 | 531 | 532 | 0 533 | 534 | 535 | 0 536 | 537 | 538 | 0 539 | 540 | 541 | Contents\Resources\StartUp\ 542 | 0 543 | 544 | 545 | Contents\Resources\StartUp\ 546 | 0 547 | 548 | 549 | Contents\Resources\StartUp\ 550 | 0 551 | 552 | 553 | 0 554 | 555 | 556 | 557 | 558 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 559 | 1 560 | 561 | 562 | 563 | 564 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 565 | 1 566 | 567 | 568 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 569 | 1 570 | 571 | 572 | 573 | 574 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 575 | 1 576 | 577 | 578 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 579 | 1 580 | 581 | 582 | 583 | 584 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 585 | 1 586 | 587 | 588 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 589 | 1 590 | 591 | 592 | 593 | 594 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 595 | 1 596 | 597 | 598 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 599 | 1 600 | 601 | 602 | 603 | 604 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 605 | 1 606 | 607 | 608 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 609 | 1 610 | 611 | 612 | 613 | 614 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 615 | 1 616 | 617 | 618 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 619 | 1 620 | 621 | 622 | 623 | 624 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 625 | 1 626 | 627 | 628 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 629 | 1 630 | 631 | 632 | 633 | 634 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 635 | 1 636 | 637 | 638 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 639 | 1 640 | 641 | 642 | 643 | 644 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 645 | 1 646 | 647 | 648 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 649 | 1 650 | 651 | 652 | 653 | 654 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 655 | 1 656 | 657 | 658 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 659 | 1 660 | 661 | 662 | 663 | 664 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 665 | 1 666 | 667 | 668 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 669 | 1 670 | 671 | 672 | 673 | 674 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 675 | 1 676 | 677 | 678 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 679 | 1 680 | 681 | 682 | 683 | 684 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 685 | 1 686 | 687 | 688 | ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 689 | 1 690 | 691 | 692 | 693 | 694 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 695 | 1 696 | 697 | 698 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 699 | 1 700 | 701 | 702 | 703 | 704 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 705 | 1 706 | 707 | 708 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 709 | 1 710 | 711 | 712 | 713 | 714 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 715 | 1 716 | 717 | 718 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 719 | 1 720 | 721 | 722 | 723 | 724 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 725 | 1 726 | 727 | 728 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 729 | 1 730 | 731 | 732 | 733 | 734 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 735 | 1 736 | 737 | 738 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 739 | 1 740 | 741 | 742 | 743 | 744 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 745 | 1 746 | 747 | 748 | ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 749 | 1 750 | 751 | 752 | 753 | 754 | 1 755 | 756 | 757 | 1 758 | 759 | 760 | 761 | 762 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 763 | 1 764 | 765 | 766 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 767 | 1 768 | 769 | 770 | 771 | 772 | ..\ 773 | 1 774 | 775 | 776 | ..\ 777 | 1 778 | 779 | 780 | 781 | 782 | 1 783 | 784 | 785 | 1 786 | 787 | 788 | 1 789 | 790 | 791 | 792 | 793 | ..\$(PROJECTNAME).launchscreen 794 | 64 795 | 796 | 797 | ..\$(PROJECTNAME).launchscreen 798 | 64 799 | 800 | 801 | 802 | 803 | 1 804 | 805 | 806 | 1 807 | 808 | 809 | 1 810 | 811 | 812 | 813 | 814 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 815 | 1 816 | 817 | 818 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 819 | 1 820 | 821 | 822 | 823 | 824 | ..\ 825 | 1 826 | 827 | 828 | ..\ 829 | 1 830 | 831 | 832 | ..\ 833 | 1 834 | 835 | 836 | 837 | 838 | Contents 839 | 1 840 | 841 | 842 | Contents 843 | 1 844 | 845 | 846 | Contents 847 | 1 848 | 849 | 850 | 851 | 852 | Contents\Resources 853 | 1 854 | 855 | 856 | Contents\Resources 857 | 1 858 | 859 | 860 | Contents\Resources 861 | 1 862 | 863 | 864 | 865 | 866 | library\lib\armeabi-v7a 867 | 1 868 | 869 | 870 | library\lib\arm64-v8a 871 | 1 872 | 873 | 874 | 1 875 | 876 | 877 | 1 878 | 879 | 880 | 1 881 | 882 | 883 | 1 884 | 885 | 886 | Contents\MacOS 887 | 1 888 | 889 | 890 | Contents\MacOS 891 | 1 892 | 893 | 894 | Contents\MacOS 895 | 1 896 | 897 | 898 | 0 899 | 900 | 901 | 902 | 903 | library\lib\armeabi-v7a 904 | 1 905 | 906 | 907 | 908 | 909 | 1 910 | 911 | 912 | 1 913 | 914 | 915 | 916 | 917 | Assets 918 | 1 919 | 920 | 921 | Assets 922 | 1 923 | 924 | 925 | 926 | 927 | Assets 928 | 1 929 | 930 | 931 | Assets 932 | 1 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | True 949 | False 950 | 951 | 952 | 12 953 | 954 | 955 | 956 | 957 |
958 | --------------------------------------------------------------------------------