Skip to content

Instantly share code, notes, and snippets.

@jarroddavis68
jarroddavis68 / StartupShutdownConsole.pas
Created February 6, 2022 00:30
Startup/Shutdown Console
procedure PostKey(aKey: word; const aShift: TShiftState; aSpeciaKey: Boolean);
{ ************************************************************
* Procedure PostKey
*
* Parameters:
* key : virtual keycode of the key to send. For printable
* keys this is simply the ANSI code (Ord(character)).
* shift : state of the modifier keys. This is a set, so you
* can set several of these keys (shift, control, alt,
* mouse buttons) in tandem. The TShiftState type is
@jarroddavis68
jarroddavis68 / DeferDelFile.pas
Created January 9, 2022 21:36
Defer Delete File
procedure DeferDelFile(const aFilename: string);
var
LCode: TStringList;
LFilename: string;
procedure C(const aMsg: string; const aArgs: array of const);
var
LLine: string;
begin
LLine := Format(aMsg, aArgs);
@jarroddavis68
jarroddavis68 / ExecuteFile.pas
Last active December 9, 2021 06:26
Execute File
function ExecuteFile(ahWnd: Cardinal; const aFilename, aParams, aStartDir: string; aShowCmd: Integer; aWait: Boolean): Integer;
var
Info: TShellExecuteInfo;
ExitCode: DWORD;
begin
Result := -1;
FillChar(Info, SizeOf(Info), 0);
Info.cbSize := SizeOf(TShellExecuteInfo);
with Info do
begin
@jarroddavis68
jarroddavis68 / PiroGameToolkit.pas
Created November 18, 2021 19:43
Piro Game Toolkit Import Unit
{==============================================================================
_____
___________(_)____________
___ __ \_ /__ ___/ __ \
__ /_/ / / _ / / /_/ /
_ .___//_/ /_/ \____/
/_/ Game Toolkit™
Copyright © 2021 tinyBigGAMES™ LLC
All Rights Reserved.
@jarroddavis68
jarroddavis68 / InterfaceFactory.pas
Created November 5, 2021 23:41
InterfaceFactory - Manage a list is generic NoRef counted interfaces.
(*******************************************************************************
InterfaceFactory - Manage a list is generic NoRef counted interfaces.
Copyright © 2021 tinyBigGAMES™ LLC
All Rights Reserved.
Website: https://tinybiggames.com
Email : [email protected]
@jarroddavis68
jarroddavis68 / interface_factory.pas
Last active November 5, 2021 13:08
Interface factory Example
program interface_factory;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Generics.Collections;