1
0
mirror of https://bitbucket.org/Dennis07/lina-components.git synced 2025-02-12 10:25:59 +02:00

Version 1.0 DEV 1.15d

Signed-off-by: Dennis07 <den.goehlert@t-online.de>
This commit is contained in:
Dennis07 2016-08-02 06:05:09 +02:00
parent 281cafb307
commit 79651c39f6
26 changed files with 762 additions and 45 deletions

View File

@ -0,0 +1,14 @@
program pExample;
uses
Vcl.Forms,
uMain in 'uMain.pas' {fmMain};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TfmMain, fmMain);
Application.Run;
end.

View File

@ -0,0 +1,170 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{B81BCCF5-1526-4845-AD3B-E68EC5AC46F9}</ProjectGuid>
<ProjectVersion>15.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>pExample.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_UsePackage>JvBDE;JvGlobus;O408br;JvMM;JvManagedThreads;FireDACSqliteDriver;DBXSqliteDriver;AbbreviaVCL;FireDACPgDriver;VampyreImagingPackage.D2009;fmx;JvDlgs;IndySystem;JvCrypt;TeeDB;frx19;inetdbbde;vclib;DBXInterBaseDriver;GR32_DSGN_RSXE5;DataSnapCommon;MiscrosoftScriptControls;pkCindyDERDXE5;JvNet;JvDotNetCtrls;DbxCommonDriver;vclimg;dbxcds;PieLib;vclshlctrls;MetropolisUILiveTile;JvXPCtrls;pkCindyPackDXE5;vcldb;vcldsnap;pkCindyIEDXE5;fmxFireDAC;pkCindyDBXDXE5;CustomIPTransport;JvCore;SynEdit_RXE5;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DebenuPDFLibraryLite;DCEF_XE5;CodeSiteExpressPkg;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;JvAppFrm;JvDB;JvRuntimeDesign;inetdbxpress;webdsnap;frxe19;JclDeveloperTools;JvDocking;adortl;JvWizards;frxDB19;FireDACASADriver;JvHMI;bindcompfmx;JvBands;vcldbx;FireDACODBCDriver;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;JvPluginSystem;Tee;JclContainers;JvCmp;vclFireDAC;JvSystem;xmlrtl;svnui;ibxpress;SVATimer_DXE5;JvControls;JvTimeFramework;IndyProtocols;DBXMySQLDriver;djsonrt;FireDACCommonDriver;O408_r;bindengine;vclactnband;soaprtl;bindcompdbx;TeeUI;FMXTee;bindcompvcl;JvStdCtrls;JvCustom;Jcl;vclie;JvJans;JvPageComps;JvPrintPreview;pkCindyDBCtrlsPackDXE5;FireDACADSDriver;vcltouch;LINA_D_XE5;VclSmp;FireDAC;VCLRESTComponents;Intraweb;GR32_RSXE5;dsnapcon;inet;fmxobj;JclVcl;JvPascalInterpreter;FireDACMySQLDriver;vclx;svn;fmxdae;RESTComponents;bdertl;FireDACMSAccDriver;dbexpress;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>O408br;FireDACSqliteDriver;DBXSqliteDriver;AbbreviaVCL;FireDACPgDriver;fmx;IndySystem;vclib;DBXInterBaseDriver;DataSnapCommon;DbxCommonDriver;vclimg;dbxcds;vclshlctrls;MetropolisUILiveTile;vcldb;vcldsnap;fmxFireDAC;CustomIPTransport;SynEdit_RXE5;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;IndyIPCommon;CloudService;FireDACIBDriver;inetdbxpress;webdsnap;adortl;FireDACASADriver;bindcompfmx;FireDACODBCDriver;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;vclFireDAC;xmlrtl;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;O408_r;bindengine;vclactnband;soaprtl;bindcompdbx;bindcompvcl;vclie;FireDACADSDriver;vcltouch;LINA_D_XE5;VclSmp;FireDAC;VCLRESTComponents;Intraweb;dsnapcon;inet;fmxobj;FireDACMySQLDriver;vclx;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DebugDCUs>true</DCC_DebugDCUs>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="uMain.pas">
<Form>fmMain</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1031</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
<VersionInfoKeys Name="package"/>
<VersionInfoKeys Name="label"/>
<VersionInfoKeys Name="versionCode"/>
<VersionInfoKeys Name="versionName"/>
<VersionInfoKeys Name="persistent"/>
<VersionInfoKeys Name="restoreAnyVersion"/>
<VersionInfoKeys Name="installLocation"/>
<VersionInfoKeys Name="largeHeap"/>
<VersionInfoKeys Name="theme"/>
</VersionInfoKeys>
<Source>
<Source Name="MainSource">pExample.dpr</Source>
</Source>
</Delphi.Personality>
<Deployment/>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899.12.30 00:00:00.000.911,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.634,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.579,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.256,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.629,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.541,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.438,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.832,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.689,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.246,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TParamDefiner\uMain.dfm=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.dfm</Transaction>
<Transaction>1899.12.30 00:00:00.000.562,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.246,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TParamDefiner\uMain.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.507,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TParamDefiner\pExample.dproj=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Project1.dproj</Transaction>
<Transaction>1899.12.30 00:00:00.000.356,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.177,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.129,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.283,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.012,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.215,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.957,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.333,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.376,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.963,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.726,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.165,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.044,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.629,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.779,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.086,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.036,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.169,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.505,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.029,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.120,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.028,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
</Transactions>
</BorlandProject>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,147 @@
object fmMain: TfmMain
Left = 0
Top = 0
Caption = 'LinaComponents "TProcessManager" Example'
ClientHeight = 419
ClientWidth = 478
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Menu = MainMenu
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object pnButtons: TPanel
Left = 0
Top = 359
Width = 478
Height = 41
Align = alBottom
TabOrder = 0
ExplicitTop = 369
ExplicitWidth = 434
DesignSize = (
478
41)
object btTerminate: TButton
Left = 394
Top = 8
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = 'Terminate'
TabOrder = 1
OnClick = btTerminateClick
ExplicitLeft = 350
end
object btRefresh: TButton
Left = 8
Top = 8
Width = 75
Height = 25
Caption = 'Refresh'
TabOrder = 0
OnClick = btRefreshClick
end
end
object ListView: TListView
Left = 0
Top = 0
Width = 478
Height = 359
Align = alClient
Columns = <
item
Caption = 'Name'
Width = 150
end
item
Caption = 'ID'
end
item
Caption = 'Priority'
end
item
Caption = 'Memory'
Width = 100
end
item
Caption = 'Name'
Width = 100
end>
GridLines = True
ReadOnly = True
RowSelect = True
TabOrder = 1
ViewStyle = vsReport
ExplicitWidth = 434
end
object StatusBar: TStatusBar
Left = 0
Top = 400
Width = 478
Height = 19
Panels = <>
SimplePanel = True
ExplicitTop = 410
ExplicitWidth = 434
end
object MainMenu: TMainMenu
Left = 392
Top = 8
object miProcess: TMenuItem
Caption = 'Process'
object miProcessLaunch: TMenuItem
Caption = 'Launch...'
OnClick = miProcessLaunchClick
end
object miProcessTerminate: TMenuItem
Caption = 'Terminate'
OnClick = miProcessTerminateClick
end
end
object miInterval: TMenuItem
Caption = 'Interval'
object miIntervalNever: TMenuItem
AutoCheck = True
Caption = 'No refresh'
RadioItem = True
OnClick = miIntervalNeverClick
end
object miInterval1000: TMenuItem
AutoCheck = True
Caption = '1000 ms'
RadioItem = True
OnClick = miInterval1000Click
end
object miInterval500: TMenuItem
AutoCheck = True
Caption = '500 ms'
RadioItem = True
OnClick = miInterval500Click
end
object miInterval200: TMenuItem
AutoCheck = True
Caption = '200 ms'
RadioItem = True
OnClick = miInterval200Click
end
object miInterval50: TMenuItem
AutoCheck = True
Caption = '50 ms'
RadioItem = True
OnClick = miInterval50Click
end
end
end
object ProcessManager: TProcessManager
OnUpdate = ProcessManagerUpdate
Left = 320
Top = 8
end
end

View File

@ -0,0 +1,161 @@
unit uMain;
//////////////////////////////////////
/// Lina Process Manager Example ///
/// **************************** ///
/// (c) 2014 Dennis Göhlert a.o. ///
//////////////////////////////////////
{$IF CompilerVersion <> 26.0}
{$MESSAGE ERROR 'This example was written to compile under Delphi XE5'}
{$ENDIF}
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
Vcl.ComCtrls, ShellAPI, uBase, uFrmCtrls, Vcl.Menus, uSysCtrls, uFileTools;
type
TfmMain = class(TForm)
pnButtons: TPanel;
btTerminate: TButton;
btRefresh: TButton;
ListView: TListView;
StatusBar: TStatusBar;
MainMenu: TMainMenu;
miProcess: TMenuItem;
miInterval: TMenuItem;
miProcessLaunch: TMenuItem;
miProcessTerminate: TMenuItem;
miIntervalNever: TMenuItem;
miInterval1000: TMenuItem;
miInterval500: TMenuItem;
miInterval200: TMenuItem;
miInterval50: TMenuItem;
ProcessManager: TProcessManager;
procedure btRefreshClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure miIntervalNeverClick(Sender: TObject);
procedure miInterval1000Click(Sender: TObject);
procedure miInterval500Click(Sender: TObject);
procedure miInterval200Click(Sender: TObject);
procedure miInterval50Click(Sender: TObject);
procedure ProcessManagerUpdate(Sender: TObject; const Modified: Boolean);
procedure miProcessLaunchClick(Sender: TObject);
procedure miProcessTerminateClick(Sender: TObject);
procedure btTerminateClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
fmMain: TfmMain;
implementation
{$R *.dfm}
procedure TfmMain.btRefreshClick(Sender: TObject);
begin
ProcessManager.Update;
end;
procedure TfmMain.btTerminateClick(Sender: TObject);
begin
if MessageDlg('Terminate process "' + ListView.Selected.Caption + '"?',mtConfirmation,mbYesNo,0) = mrYes then
begin
ProcessManager.Kill(ListView.Selected.Caption);
end;
end;
procedure TfmMain.FormCreate(Sender: TObject);
begin
btRefresh.Click;
miInterval1000.Click;
end;
procedure TfmMain.miInterval1000Click(Sender: TObject);
begin
ProcessManager.RefreshMode := prTime;
ProcessManager.Interval := 1000;
end;
procedure TfmMain.miInterval200Click(Sender: TObject);
begin
ProcessManager.RefreshMode := prTime;
ProcessManager.Interval := 200;
end;
procedure TfmMain.miInterval500Click(Sender: TObject);
begin
ProcessManager.RefreshMode := prTime;
ProcessManager.Interval := 500;
end;
procedure TfmMain.miInterval50Click(Sender: TObject);
begin
ProcessManager.RefreshMode := prTime;
ProcessManager.Interval := 50;
end;
procedure TfmMain.miIntervalNeverClick(Sender: TObject);
begin
ProcessManager.RefreshMode := prNone;
end;
procedure TfmMain.miProcessLaunchClick(Sender: TObject);
var
FileName: String;
begin
if InputQuery('Launch','File name:',FileName) and (Length(FileName) <> 0) then
begin
ProcessManager.Start(FileName);
end;
end;
procedure TfmMain.miProcessTerminateClick(Sender: TObject);
begin
btTerminate.Click;
end;
procedure TfmMain.ProcessManagerUpdate(Sender: TObject;
const Modified: Boolean);
var
Index: Integer;
begin
while ListView.Items.Count < ProcessManager.Names.Count do
begin
ListView.Items.Add;
end;
while ListView.Items.Count > ProcessManager.Names.Count do
begin
ListView.Items.Delete(ListView.Items.Count - 1);
end;
for Index := 0 to ProcessManager.Names.Count - 1 do
begin
ListView.Items.Item[Index].Caption := ProcessManager.Names.Strings[Index];
while ListView.Items.Item[Index].SubItems.Count <> 4 do
begin
ListView.Items.Item[Index].SubItems.Add('');
end;
ListView.Items.Item[Index].SubItems.Strings[0] := IntToStr(ProcessManager.GetID(ProcessManager.Names.Strings[Index]));
ListView.Items.Item[Index].SubItems.Strings[1] := IntToStr(ProcessManager.GetPriority(ProcessManager.Names.Strings[Index]));
try
ListView.Items.Item[Index].SubItems.Strings[2] := IntToStr(ConvertFileSize(ProcessManager.GetMemory(ProcessManager.Names.Strings[Index]), B_TO_KB)) + ' K';
except
ListView.Items.Item[Index].SubItems.Strings[2] := '?';
end;
try
ListView.Items.Item[Index].SubItems.Strings[3] := ProcessManager.GetUser(ProcessManager.Names.Strings[Index]);
except
ListView.Items.Item[Index].SubItems.Strings[3] := '?';
end;
end;
StatusBar.SimpleText := IntToStr(ListView.Items.Count) + ' processes listed';
end;
end.

View File

@ -62,14 +62,14 @@
<DCC_UsePackage>rtl;dbrtl;IndySystem;IndyProtocols;IndyCore;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_UsePackage>rtl;vcl;dbrtl;IndySystem;IndyProtocols;IndyCore;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_UsePackage>rtl;vcl;dbrtl;IndySystem;IndyProtocols;IndyCore;vclx;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>rtl;vcl;dbrtl;IndySystem;IndyProtocols;IndyCore;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_UsePackage>rtl;vcl;dbrtl;IndySystem;IndyProtocols;IndyCore;vclx;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>

View File

@ -1,53 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899.12.30 00:00:00.000.173,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uInit.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.518,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.938,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\Config.inc</Transaction>
<Transaction>1899.12.30 00:00:00.000.934,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\Config.inc</Transaction>
<Transaction>1899.12.30 00:00:00.000.508,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBase.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.681,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc=</Transaction>
<Transaction>1899.12.30 00:00:00.000.809,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc</Transaction>
<Transaction>1899.12.30 00:00:00.000.325,=dbrtl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.592,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uFileTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.576,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.648,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uScriptMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.577,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.861,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Settings.inc</Transaction>
<Transaction>1899.12.30 00:00:00.000.537,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm=C:\Users\Dennis G\Documents\CodeQuality.htm</Transaction>
<Transaction>1899.12.30 00:00:00.000.633,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\LINA_D_XE5.dproj=C:\Users\Dennis\Documents\RAD Studio\Projekte\Package1.dproj</Transaction>
<Transaction>1899.12.30 00:00:00.000.143,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm</Transaction>
<Transaction>1899.12.30 00:00:00.000.318,=vcl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.896,C:\Users\Dennis G\Documents\CodeQuality.htm=</Transaction>
<Transaction>1899.12.30 00:00:00.000.518,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.681,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc=</Transaction>
<Transaction>1899.12.30 00:00:00.000.325,=dbrtl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.809,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc</Transaction>
<Transaction>1899.12.30 00:00:00.000.938,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\Config.inc</Transaction>
<Transaction>1899.12.30 00:00:00.000.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.414,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas=</Transaction>
<Transaction>1899.12.30 00:00:00.000.556,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uLocalMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.592,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uFileTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.971,=IndySystem.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.196,=rtl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.577,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.861,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Settings.inc</Transaction>
<Transaction>1899.12.30 00:00:00.000.318,=vcl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.648,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uScriptMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.934,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\Config.inc</Transaction>
<Transaction>1899.12.30 00:00:00.000.537,C:\Users\Dennis G\Documents\CodeQuality.htm=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm</Transaction>
<Transaction>1899.12.30 00:00:00.000.143,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm</Transaction>
<Transaction>1899.12.30 00:00:00.000.896,C:\Users\Dennis G\Documents\CodeQuality.htm=</Transaction>
<Transaction>1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.555,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBase.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.075,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCalc.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.971,=IndySystem.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.584,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uVirtObj.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.686,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uSysTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.525,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCrypt.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.075,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCalc.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.196,=rtl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.118,=IndyCore.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.535,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.672,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uFrmCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.633,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLocalMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.525,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCrypt.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.686,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uSysTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.672,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uFrmCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.633,C:\Users\Dennis\Documents\RAD Studio\Projekte\Package1.dproj=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\LINA_D_XE5.dproj</Transaction>
<Transaction>1899.12.30 00:00:00.000.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.674,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.546,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFrmCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.173,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uInit.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.857,=PascalScript_Core_D19.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.045,=IndyProtocols.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.799,=PascalScript_Core_D19.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.566,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uScriptMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.546,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFrmCtrls.pas</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\..\LinaComponents"/>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -156,7 +156,8 @@ type
function DriveExists(DriveByte: Byte): Boolean;
function GetDriveTypeChar(DriveByte: Byte): UINT;
function FileTimeToDateTime(FileTime: TFileTime): TDateTime;
function ConvertFileSize(const InputSize: Int64; ConvertFactor: ShortInt = -1): Extended;
function ConvertFileSize(const InputSize: Extended; ConvertFactor: ShortInt = -1): Extended; overload;
function ConvertFileSize(const InputSize: Int64; ConvertFactor: ShortInt = -1): Int64; overload;
function GetFileSize(FileName: String): Int64;
function GetFileModified(FileName: String): TDateTime;
function GetFileCreated(FileName: String): TDateTime;
@ -561,11 +562,18 @@ begin
Result := SystemTimeToDateTime(SysTime);
end;
function ConvertFileSize(const InputSize: Int64; ConvertFactor: ShortInt = -1): Extended;
function ConvertFileSize(const InputSize: Extended; ConvertFactor: ShortInt = -1): Extended;
begin
{ Sollte verwendet werden mit den Umrechnungs-Faktoren, die in der globalen
"const"-Section deklariert wurden. }
Result := InputSize * Power(1024,ConvertFactor);
Result := InputSize * IntPower(1024,ConvertFactor);
end;
function ConvertFileSize(const InputSize: Int64; ConvertFactor: ShortInt = -1): Int64;
begin
{ Sollte verwendet werden mit den Umrechnungs-Faktoren, die in der globalen
"const"-Section deklariert wurden. }
Result := Round(InputSize * IntPower(1024,ConvertFactor));
end;
function GetFileSize(FileName: String): Int64;

View File

@ -20,7 +20,6 @@ uses
type
{ Fehlermeldungen }
EInvalidParamChar = class(Exception);
EParamNotFound = class(Exception);
EInvalidParamIdentifier = class(Exception);
EInvalidParamFormat = class(Exception);
EInvalidDiagramGap = class(Exception);
@ -2082,7 +2081,6 @@ begin
end;
//For (ParamIndex)
end;
raise EParamNotFound.Create('Parameter "' + Identifier + '" not found');
end;
function TParamReference.AsText(UseDefVal: Boolean = False): String;

View File

@ -12,7 +12,7 @@ interface
uses
{ Standard-Units }
SysUtils, Classes, Windows, ExtCtrls, Registry, TlHelp32, PsAPI, dialogs,
SysUtils, Classes, Windows, ExtCtrls, Registry, TlHelp32, PsAPI,
{ Andere Package-Units }
uBase, uSysTools, uFileTools;
@ -38,6 +38,7 @@ type
type
{ Ereignisse }
TProcessManagerUpdateEvent = procedure(Sender: TObject; const Modified: Boolean) of object;
TStringContainerChangeEvent = procedure(Sender: TObject) of object;
TStringContainerChangingEvent = procedure(Sender: TObject) of object;
TCryptWorkEvent = procedure(Sender: TObject) of object;
@ -46,6 +47,12 @@ type
type
{ Hauptklassen }
PTOKEN_USER = ^TOKEN_USER;
_TOKEN_USER = record
User: TSidAndAttributes;
end;
TOKEN_USER = _TOKEN_USER;
{$IFNDEF NO_MULTIPLATFORM}
[ComponentPlatformsAttribute(pidWin32 or pidWin64)]
{$ENDIF}
@ -98,6 +105,8 @@ type
FNames: TStrings;
FTimeOut: DWORD;
FRefreshMode: TProcessRefreshMode;
{ Ereignisse }
FUpdateEvent: TProcessManagerUpdateEvent;
{ Methoden }
function GetNames: TStrings;
procedure SetRefreshMode(Value: TProcessRefreshMode);
@ -109,13 +118,22 @@ type
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Update;
procedure Kill(ProcID: DWORD);
procedure Kill(ProcID: DWORD); overload;
procedure Kill(ProcName: String); overload;
procedure Start(FileName: String);
function GetID(ProcName: String): DWORD;
function GetPath(ProcID: DWORD): String;
function GetName(ProcID: DWORD): String;
function GetPath(ProcID: DWORD): String; overload;
function GetPath(ProcName: String): String; overload;
function GetThreads(ProcName: String): DWORD;
function GetParentID(ProcName: String): DWORD;
function GetPriority(ProcName: String): Integer;
function GetMemory(ProcID: DWORD): DWORD;
function GetMemory(ProcID: DWORD): DWORD; overload;
function GetMemory(ProcName: String): DWORD; overload;
function GetUser(ProcID: DWORD): String; overload;
function GetUser(ProcName: String): String; overload;
function GetDomain(ProcID: DWORD): String; overload;
function GetDomain(ProcName: String): String; overload;
property Names: TStrings read GetNames;
published
{ Published-Deklarationen }
@ -123,6 +141,8 @@ type
property TimeOut: DWORD read FTimeOut write FTimeOut default 0;
property RefreshMode: TProcessRefreshMode read FRefreshMode write SetRefreshMode default prNone;
property Interval: Cardinal read GetInterval write SetInterval default 1000;
{ Ereignisse }
property OnUpdate: TProcessManagerUpdateEvent read FUpdateEvent write FUpdateEvent;
end;
{$IFNDEF NO_MULTIPLATFORM}
@ -636,17 +656,19 @@ end;
procedure TProcessManager.Update;
var
OldNames: String;
Snapshot: THandle;
ProcEntry: TProcessEntry32;
begin
FNames.Clear;
OldNames := Names.Text;
Names.Clear;
Snapshot := CreateToolHelp32Snapshot(TH32CS_SNAPPROCESS,0);
try
ProcEntry.dwSize := SizeOf(ProcEntry);
if Process32First(Snapshot,ProcEntry) = True then
begin
repeat
FNames.Add(ProcEntry.szExeFile);
Names.Add(ProcEntry.szExeFile);
until (Process32Next(Snapshot,ProcEntry) = False)
end else
begin
@ -655,6 +677,10 @@ begin
finally
CloseHandle(Snapshot);
end;
if Assigned(OnUpdate) then
begin
OnUpdate(Self,OldNames = Names.Text);
end;
end;
function TProcessManager.GetInterval: Cardinal;
@ -702,6 +728,16 @@ begin
end;
end;
procedure TProcessManager.Kill(ProcName: String);
begin
Kill(GetID(ProcName));
end;
procedure TProcessManager.Start(FileName: String);
begin
ExecuteFile(FileName);
end;
function TProcessManager.GetID(ProcName: String): DWORD;
var
Snapshot: THandle;
@ -729,6 +765,33 @@ begin
end;
end;
function TProcessManager.GetName(ProcID: DWORD): String;
var
Snapshot: THandle;
ProcEntry: TProcessEntry32;
begin
Result := '';
Snapshot := CreateToolHelp32Snapshot(TH32CS_SNAPPROCESS,0);
try
ProcEntry.dwSize := SizeOf(ProcEntry);
if Process32First(Snapshot,ProcEntry) then
begin
repeat
if ProcEntry.th32ProcessID = ProcID then
begin
Result := ProcEntry.szExeFile;
Break;
end;
until (Process32Next(Snapshot,ProcEntry) = False)
end else
begin
RaiseLastOSError;
end;
finally
CloseHandle(Snapshot);
end;
end;
function TProcessManager.GetPath(ProcID: DWORD): String;
var
Snapshot: THandle;
@ -750,6 +813,11 @@ begin
end;
end;
function TProcessManager.GetPath(ProcName: String): String;
begin
Result := GetPath(GetID(ProcName));
end;
function TProcessManager.GetThreads(ProcName: String): DWORD;
var
Snapshot: THandle;
@ -846,6 +914,117 @@ begin
end;
end;
function TProcessManager.GetMemory(ProcName: String): DWORD;
begin
Result := GetMemory(GetID(ProcName));
end;
function TProcessManager.GetUser(ProcID: DWORD): String;
var
Process: THandle;
Token: THandle;
Buffer: DWORD;
User: PTOKEN_USER;
NameUse: SID_NAME_USE;
Success: Boolean;
Size: DWORD;
DomainBuffer: String;
begin
Result := '';
Process := OpenProcess(PROCESS_QUERY_INFORMATION,False,ProcID);
if Process <> 0 then
begin
if OpenProcessToken(Process,TOKEN_QUERY,Token) then
begin
Success := GetTokenInformation(Token,TokenUser,nil,0,Buffer);
User := nil;
while (Success = False) and (GetLastError = ERROR_INSUFFICIENT_BUFFER) do
begin
ReallocMem(User,Buffer);
Success := GetTokenInformation(Token,TokenUser,User,Buffer,Buffer);
end;
CloseHandle(Token);
if Success = False then
begin
RaiseLastOSError;
end;
LookupAccountSid(nil,User.User.Sid,nil,Size,nil,Buffer,NameUse);
if Size <> 0 then
begin
SetLength(Result,Size);
SetLength(DomainBuffer,Buffer);
LookupAccountSid(nil,User.User.Sid,PChar(Result),Size,PChar(DomainBuffer),Buffer,NameUse);
end;
FreeMem(User);
end else
begin
RaiseLastOSError;
end;
CloseHandle(Process);
end else
begin
RaiseLastOSError;
end;
end;
function TProcessManager.GetUser(ProcName: String): String;
begin
Result := GetUser(GetID(ProcName));
end;
function TProcessManager.GetDomain(ProcID: DWORD): String;
var
Process: THandle;
Token: THandle;
Buffer: DWORD;
User: PTOKEN_USER;
NameUse: SID_NAME_USE;
Success: Boolean;
Size: DWORD;
UserBuffer: String;
begin
Result := '';
Process := OpenProcess(PROCESS_QUERY_INFORMATION,False,ProcID);
if Process <> 0 then
begin
if OpenProcessToken(Process,TOKEN_QUERY,Token) then
begin
Success := GetTokenInformation(Token,TokenUser,nil,0,Buffer);
User := nil;
while (Success = False) and (GetLastError = ERROR_INSUFFICIENT_BUFFER) do
begin
ReallocMem(User,Buffer);
Success := GetTokenInformation(Token,TokenUser,User,Buffer,Buffer);
end;
CloseHandle(Token);
if Success = False then
begin
RaiseLastOSError;
end;
LookupAccountSid(nil,User.User.Sid,nil,Buffer,nil,Size,NameUse);
if Size <> 0 then
begin
SetLength(Result,Size);
SetLength(UserBuffer,Buffer);
LookupAccountSid(nil,User.User.Sid,PChar(UserBuffer),Buffer,PChar(Result),Size,NameUse);
end;
FreeMem(User);
end else
begin
RaiseLastOSError;
end;
CloseHandle(Process);
end else
begin
RaiseLastOSError;
end;
end;
function TProcessManager.GetDomain(ProcName: String): String;
begin
Result := GetDomain(GetID(ProcName));
end;
{ ----------------------------------------------------------------------------
TStringContainer
---------------------------------------------------------------------------- }