Exit programs automatically by System unit

This commit is contained in:
Владислав Джавадов 2020-06-07 21:55:00 +03:00
parent 7add2ddf38
commit b366037e72
17 changed files with 20 additions and 26 deletions

View File

@ -52,7 +52,7 @@ begin
BLACK_BUTTON:
SetWindowCaption('Black');
1:
TerminateThread;
Break;
end;
end;
end.

View File

@ -50,5 +50,4 @@ begin
until KBHit;
ConsoleExit(1);
TerminateThread;
end.

View File

@ -90,6 +90,6 @@ begin
GetKey;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
end;
end.

View File

@ -148,6 +148,6 @@ begin
GetKey;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
end;
end.

View File

@ -43,6 +43,6 @@ begin
end;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
end;
end.

View File

@ -32,5 +32,4 @@ begin
printf('CurrentDirectory is "%s"'#10, Buffer);
ConsoleExit(0);
TerminateThread;
end.

View File

@ -53,6 +53,6 @@ begin
end;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
end;
end.

View File

@ -57,7 +57,7 @@ begin
end;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
NO_EVENT:
UpdateInfo;
end;

View File

@ -28,6 +28,6 @@ begin
GetKey;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
end;
end.

View File

@ -24,5 +24,4 @@ begin
WriteN(Buffer, FileSize);
ConsoleExit(0);
TerminateThread;
end.

View File

@ -65,5 +65,4 @@ begin
end;
ConsoleExit(0);
TerminateThread;
end.

View File

@ -90,6 +90,6 @@ begin
GetKey;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
end;
end.

View File

@ -130,7 +130,7 @@ begin
WAIT_BUTTON:
SetCursor(hWaitCursor);
1:
TerminateThread;
Break;
end;
end;
end.

View File

@ -46,6 +46,6 @@ begin
GetKey;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
end;
end.

View File

@ -79,6 +79,6 @@ begin
OnKey;
BUTTON_EVENT:
if GetButton.ID = 1 then
TerminateThread;
Break;
end;
end.

View File

@ -7,8 +7,6 @@ unit SysInit;
interface
procedure _InitExe;
procedure _Halt0;
procedure _InitLib(Context: PInitContext);
var
ModuleIsLib: Boolean;
@ -20,16 +18,8 @@ const
implementation
procedure _InitLib(context: pinitcontext);
asm
end;
procedure _InitExe;
asm
end;
procedure _Halt0;
asm
end;
end.
end.

View File

@ -29,6 +29,7 @@ type
DLLInitState: byte;
end;
procedure _Halt0;
procedure _HandleFinally;
implementation
@ -36,6 +37,13 @@ implementation
uses
SysInit;
procedure _Halt0;
asm
XOR EAX, EAX
DEC EAX
INT $40
end;
procedure _HandleFinally;
asm
end;