Posts

Delphi and stuff

Occasional babble mostly related to Borland Delphi Delphi and stuff

Microsoft Patch API

unit Patchapi; interface uses Windows, SysUtils; const PATCH_OPTION_USE_BEST = $00000000; // auto choose best (slower) PATCH_OPTION_USE_LZX_BEST = $00000003; // auto choose best of LZX PATCH_OPTION_USE_LZX_A = $00000001; // normal PATCH_OPTION_USE_LZX_B = $00000002; // better on some x86 binaries PATCH_OPTION_USE_LZX_LARGE = $00000004; // better support for files >8MB PATCH_OPTION_NO_BINDFIX = $00010000; // PE bound imports PATCH_OPTION_NO_LOCKFIX = $00020000; // PE smashed locks PATCH_OPTION_NO_REBASE = $00040000; // PE rebased image PATCH_OPTION_FAIL_IF_SAME_FILE = $00080000; // don't create if same PATCH_OPTION_FAIL_IF_BIGGER = $00100000; // fail if patch is larger than simply compressing new file (slower) PATCH_OPTION_NO_CHECKSUM = $00200000; // PE checksum zero PATCH_OPTION_NO_RESTIMEFIX = $00400000; // PE resource timestamps PATCH_OPTION_NO_TIMESTAMP = $00800000; // don't store new file timestamp in patch PATCH_OPTION_SIGNATUR...

Using waitable timer in Delphi

procedure Wait(lNumberOfSeconds : Longint); const _SECOND = 10000000; var lBusy : LongInt; hTimer : LongInt; liDueTime : LARGE_INTEGER; begin hTimer := CreateWaitableTimer(nil, True, 'WaitableTimer'); if hTimer = 0 then Exit; liDueTime.QuadPart := -10000000 * lNumberOfSeconds; SetWaitableTimer(hTimer, TLargeInteger(liDueTime), 0, nil, nil, False); repeat lBusy := MsgWaitForMultipleObjects(1, hTimer, False, INFINITE, QS_ALLINPUT); Application.ProcessMessages; Until lBusy = WAIT_OBJECT_0; // Close the handles when you are done with them. CloseHandle(hTimer); End; procedure TForm1.Button1Click(Sender: TObject); begin form1.Caption := 'start'; wait(10); form1.Caption := 'done'; end;

Using HourGlass cursor and autorestore it to default application cursor

{***************************************************************************** Name : WaitForTask Author : Perevoznyk Serhiy Description : History : Date By Description ---- -- ----------- 08-07-2005 Perevoznyk Serhiy Initial creation of the Unit. *****************************************************************************} unit WaitForTask; interface uses Windows, Messages, SysUtils, Classes, Controls, Forms; type TCursorRestorer = class(TInterfacedObject) private FCursor : TCursor; FWindowHandle: HWND; FWaitTime : integer; protected procedure WndProc(var Msg: TMessage); public constructor Create(WaitTime : integer =0); virtual; destructor Destroy; override; procedure Restore; end; function Busy(WaitTime : integer = 0) : IUnknown; procedure WaitSleep(MS : Longint); implementation { TCursorRestorer } constructor TCursorRestorer.Create; begin ...

Simple way to execute ADO Query

With this unit you can create and execute queries without using ADO components. The size of application is dramatically smaller.... unit ADOSupport; interface uses Windows, SysUtils, ActiveX, ADOInt; function ExecuteADOSQL(ConnectionString : string; UserName : string; Password : string; command : string) : integer; function CreateADOConnection(ConnectionString : string; UserName : string; Password : string) : _Connection; procedure ExecuteADOQuery(Connection : _Connection; command : string); procedure CloseConnection(Connection : _Connection); implementation function Succeeded(Res: HResult): Boolean; begin Result := Res and $80000000 = 0; end; function CreateADOObject(const ClassID: TGUID): IUnknown; var Status: HResult; FPUControlWord: Word; begin asm FNSTCW FPUControlWord end; Status := CoCreateInstance(ClassID, nil, CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IUnknown, Result); asm FNCLEX FLDCW FPUControlWord end; if (Status = REGDB_E_CLAS...

Custom implementation of the GUID generation

{***************************************************************************** Name : GuidGen Author : Perevoznyk Serhiy Description : Custom implementation of the GUID generation History : Date By Description ---- -- ----------- 5/13/05 Perevoznyk Serhiy Initial creation of the Unit. *****************************************************************************} unit GuidGen; interface uses Windows, SysUtils; const PROV_RSA_FULL = 1; CRYPT_VERIFYCONTEXT = $f0000000; ReservedNCS = $00; Standard = $02; ReservedMicrosoft = $06; ReservedFuture = $07; TimeBased = $01; Reserved = $02; NameBased = $03; VRandom = $04; VariantByte = 8; VariantByteMask = $3f; VariantByteShift = 6; VersionByte = 7; VersionByteMask = $0f; VersionByteShift = 4; {:----------------------------------------------------------------------------- The CryptAcquireContext function is used to acquire a handle to a particular key containe...

Ondertitels - Download hier Nederlandse Ondertitels - NLondertitels.com

Ondertitels - Download hier Nederlandse Ondertitels - NLondertitels.com

Useful software

Audacity 1.2.4 http://audacity.sourceforge.net DVD Shrink 3.2.0.15 www.afterdawn.com AutoGK 2.20 www.autogk.me TwinkleSoft MediaRecorder 1.1 www.twinklesoft.com MP3Tag 4.96 www.maniactools.com iTunes 6.0.1.3 www.apple.com/benl/itunes Winamp 5.12 www.winamp.be VLC Media Player 0.8.4 www.videolan.org/vlc MP3Gain 1.2.5 http://prdownloads.sourceforge.net/mp3gain Juice 2.1 http://juicereceiver.sourceforge.net Firefox 1.5 www.getfirefox.com IE View 1.2.7 https://addons.mozilla.org/extensions FlashGot 0.5.9.98 http://flashgot.net Adblock 0.5.2.056 https://addons.mozilla.org/extensions Sage https://addons.mozilla.org/extensions ScrapBook https://addons.mozilla.org/extensions FoxyTunes 1.2 www.foxytunes.org Skype 2.0.0.43 http://skype.com MSN Messenger 7.5 http://messenger.msn.be Messenger Jump! www.softonic.com Trillian 3.1 www.ceruleanstudios.com RoboForm 6.5 www.roboform.com Xfire 1.48 www.xfire.com Hitman Pro 2.3.3 www.hitmanpro.nl Windows Antispyware 1.0.701 www.microsoft.com/antispyware X...

Delphi beacon

Delphi beacon My personal web-site, related to Delphi development. It contains components (freeware), articles and more...