Shade components

January 23, 2020 0

Shade components procedure ShadeIt(f: TForm; c: TControl; Width: Integer; Color: TColor); var rect: TRect; old: TColor; begin if (c.Visible) then begin rect := c.BoundsRect; rect.Left := rect.Left + Width; rect.Top := rect.Top + Width; rect.Right […]

Make a window always minimized

January 17, 2020 0

Make a window always minimized // Form1.Windowstate := wsMinimized; unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private procedure WMQueryOpen(var Msg: […]

Placing a TProgressBar into a TStatusBar

April 18, 2017 0

Most applications provide an area in the application's main form, usually aligned at the bottom of a form, used to display information about the application as it runs. A TStatusBar component (located on the "Win32" […]

Extract Icons from a File – delphi

January 15, 2020 0

// Extract Icons from a File uses shellApi; {…} procedure TForm1.Button1Click(Sender: TObject); const ExtrFileName = ‘C:\WINNT\system32\moricons.dll’; var icon: TIcon; NumberOfIcons, i: Integer; begin icon := TIcon.Create; try // Get the number of Icons NumberOfIcons := […]

Retrieve a shortcut’s link information

January 17, 2020 0

Retrieve a shortcut’s link information from delphi uses ShlObj, ComObj, ActiveX, CommCtrl; type PShellLinkInfoStruct = ^TShellLinkInfoStruct; TShellLinkInfoStruct = record FullPathAndNameOfLinkFile: array[0..MAX_PATH] of Char; FullPathAndNameOfFileToExecute: array[0..MAX_PATH] of Char; ParamStringsOfFileToExecute: array[0..MAX_PATH] of Char; FullPathAndNameOfWorkingDirectroy: array[0..MAX_PATH] of Char; […]

FAST Pos() replacement

January 9, 2020 0

unit asm_pos; interface function Pos_Sensitive(const SubStr: AnsiString; const Str: AnsiString): Integer; function Pos_Insensitive(const SubStr, S: string; Offset: Integer = 1): Integer; implementation //————————————————————————// // Fast case INsensitive Pos replacement function Pos_Insensitive(const SubStr, S: string; Offset: […]

Calculate the checksum of a file

January 17, 2020 0

Calculate the checksum of a file function GetCheckSum(FileName: string): DWORD; var F: file of DWORD; P: Pointer; Fsize: DWORD; Buffer: array [0..500] of DWORD; begin FileMode := 0; AssignFile(F, FileName); Reset(F); Seek(F, FileSize(F) div 2); […]

Pascal – Booleans

July 5, 2019 0

Pascal provides data type Boolean that enables the programmers to define, store and manipulate logical entities, such as constants, variables, functions and expressions, etc. Boolean values are basically integer type. Boolean type variables have two […]

Arduino – Program Structure

April 25, 2017 0

In this chapter, we will study in depth, the Arduino program structure and we will learn more new terminologies used in the Arduino world. The Arduino software is open-source. The source code for the Java […]

Get directory size from delphi

January 15, 2020 0

// Get directory size function GetDirSize(dir: string; subdir: Boolean): Longint; var rec: TSearchRec; found: Integer; begin Result := 0; if dir[Length(dir)] ‘\’ then dir := dir + ‘\’; found := FindFirst(dir + ‘*.*’, faAnyFile, rec); […]

Show a form without focusing

January 17, 2020 0

Show a form without focusing in TCustomForm class,in protected section add procedure ShowParam(var param : integer);dynamic; { this procedure call when form should be show, now you should override this method and write your option […]

Position a messagebox over a form

January 17, 2020 0

Position a messagebox over a form const mbMessage = WM_USER + 1024; type private procedure ChangeMessageBoxPosition(var Msg: TMessage); message mbMessage; end; var Form1: TForm1; msgCaption: PChar; // variable to hold the caption implementation {$R *.DFM} […]

Follow on Facebook