More Programming Articles Page 12

  • Icon on the desktop

    This article shows how to add a link on the desktop to your application.Adding a link (lnk) to the desktop directory is pretty simple. First we will need to create a...
  • Days in month

    This article demonstrates how to detect how many days there are in a given month.procedure TForm1.Button1Click(Sender: TObject); var MyDate : TDateTime; tmpStr :...
  • Filter HTML tags out of a string.

    A little RegEx Filter out any HTML tags passed in a string.<cfset MyString = REReplace(MyString, "<[^>]*>", "", "All")>...
  • Hash anyone ?

    This article demonstrates a simple hashing algorythm.function HashElf(const Buf; BufSize: Integer): Integer; var Bytes: TByteArray absolute Buf; I, X: Integer;...
  • Accessing ASP objects in Delphi

    This article demonstrates how to use COM to access ASP objects such as Session.1. Create a MTS object (look under the Multitier page in File->New...)2. Name it...
  • Change numbers in a string to asterisks.

    A little regular expression to change all numbers in a string to asterisks. <cfset MyString = REReplace(MYString, [[:digit:]], *,ALL)> Example: <!--- Fill...
  • Hiding icons on the desktop

    This article demonstrates how to hide all icons on the desktop.var DesktopWnd : HWND; procedure TForm1.Button1Click(Sender: TObject); begin DesktopWnd :=...
  • Autorun CD

    This article demonstrates how to turn AutoRun on / off for your CD drive.procedure TForm1.SetCDAutoRun(AAutoRun:Boolean);const DoAutoRun : array[Boolean] of Integer =...
  • Cut, Copy and Paste the easy way

    This is the EASY way to add CUT / COPY / PASTE capabilities to your app.This solution for cut, copy and paste will work with ANY component. And, I'm sure you will...
  • Hiding the windows start button

    This article demonstrates how to hide the start button in Windows.procedure hideStartbutton(visi:boolean); Var Tray, Child : hWnd; C : Array[0..127] of Char; S :...
  • Callback a class

    This article demonstrates how to use an instance of a class as a callback.If you wanted a windows callback to call an instance of a class, simply replace TMyClass with...
  • Protected properties

    How to access properties and methods in the PROTECTED section of a class.This one really is simple. It is also very well known, but I'll include it here just for all...
  • Hiding applications

    How to hide a Delphi application.program Project1; uses Forms, Unit1 in 'Unit1.pas' {Form1}, Windows; {$R *.RES} //Declare a var to retrieve current window...
  • Detecting CD insert / eject

    This article shows how to detect when a CD has been inserted / removed.type TForm1 = class(TForm) private { Private declarations } procedure...
  • Disable task switching

    This article demonstrates how to enable / disable task switching.var OldValue : LongBool; begin {turns the trap on} SystemParametersInfo(97, Word(True),...
  • Drag and drop from explorer

    This article demonstrates how to accept files dropped from outside of your Delphi application.unit Unit1; interface uses Windows, Messages, SysUtils, Classes,...
  • Moving controls at runtime

    This article shows how to move controls at runtime.It is quite simple, in the OnMouseDown event of the control add this code. ReleaseCapture;(Sender as...
  • Format of a WAV file

    This article shows the format of a WAV file.TWaveHeader = record Marker1: Array[0..3] of Char; BytesFollowing: LongInt; Marker2: Array[0..3] of Char; Marker3:...
  • Extract small icon

    This article demonstrates how to extract a small icon from an application.function GetSmallIcon(const AFile : String) : THandle; var Info : TSHFileInfo; InfoSize :...
  • Altering the scrollbar

    This article demonstrates how to alter the appearence of the scroll bar.Include this code in the <HEAD> section of your document. <style...
  • Converting WAV to MP3 and back

    This article covers a brief introduction to the windows Audio Compression Manager API.This is a copy of an article I wrote for the Delphi Developer Newsletter The...
  • Playing with fonts

    This tip will show you how to take your TForm.Canvas and draw some angled text on it while preserving the original font and brush values for other operations. Working...
  • Application version number

    How to get the version number of an application at runtimeunit GetVersionInfo;interfaceuses Windows, Classes, SysUtils;procedure GetProjectVersionInfo(AVersionList:...
  • The Infamous "Green Bar" effect

    Output database results in differing coloured tabledata's using the IIF function.<CFQUERY dbtype="ODBC" datasource="Examples"...
  • Format a drive

    This article demonstrates how to format a drive from a Delphi application.procedure FormatDriveDialog; begin ShellExecute(Application.Handle, 'Open', ...
  • Sending files to the recycle bin

    This article shows how to send a file to the recyle bin rather than deleting immediately.unit RecycleBin; interface uses Windows, ShellApi; function...
  • Decimal to roman numerals

    This article demonstrates how to convert a given number to Roman Numerals in Delphi.function DecToRoman ( iDecimal: longint ): string; const aRomans: array [ 1..13 ]...