Стартовый пул
This commit is contained in:
82
UniqueInstance/testraw/project1.lpi
Normal file
82
UniqueInstance/testraw/project1.lpi
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<LRSInOutputDirectory Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="uniqueinstance_package"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="project1"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<SrcPath Value="$(LazarusDir)\lcl;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<UseAnsiStrings Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseHeaptrc Value="True"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerMessages>
|
||||
<UseMsgFile Value="True"/>
|
||||
</CompilerMessages>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
</CONFIG>
|
21
UniqueInstance/testraw/project1.lpr
Normal file
21
UniqueInstance/testraw/project1.lpr
Normal file
@@ -0,0 +1,21 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms
|
||||
{ add your units here }, Unit1, UniqueInstanceRaw;
|
||||
|
||||
begin
|
||||
if not InstanceRunning('project1ver3') then
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end;
|
||||
end.
|
||||
|
22
UniqueInstance/testraw/unit1.lfm
Normal file
22
UniqueInstance/testraw/unit1.lfm
Normal file
@@ -0,0 +1,22 @@
|
||||
object Form1: TForm1
|
||||
Left = 344
|
||||
Height = 136
|
||||
Top = 152
|
||||
Width = 295
|
||||
HorzScrollBar.Page = 294
|
||||
VertScrollBar.Page = 135
|
||||
Caption = 'Test UniqueInstanceRaw'
|
||||
ClientHeight = 136
|
||||
ClientWidth = 295
|
||||
LCLVersion = '0.9.31'
|
||||
object ButCrashApp: TButton
|
||||
Left = 64
|
||||
Height = 32
|
||||
Top = 48
|
||||
Width = 158
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'Crash Application'
|
||||
OnClick = ButCrashAppClick
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
55
UniqueInstance/testraw/unit1.pas
Normal file
55
UniqueInstance/testraw/unit1.pas
Normal file
@@ -0,0 +1,55 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
ButCrashApp: TButton;
|
||||
procedure ButCrashAppClick(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{$ifdef unix}
|
||||
uses
|
||||
BaseUnix;
|
||||
{$endif}
|
||||
|
||||
{$ifdef windows}
|
||||
uses
|
||||
Windows;
|
||||
{$endif}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.ButCrashAppClick(Sender: TObject);
|
||||
begin
|
||||
{$ifdef unix}
|
||||
FpKill(FpGetpid, 9);
|
||||
{$endif}
|
||||
{$ifdef windows}
|
||||
TerminateProcess(GetCurrentProcess, 0);
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user