More Programming Articles Page 12

  • 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 ]...
  • How To Launch the Control Panel

    This article shows how to show the control panel.WinExec('rundll32 shell32.dll,Control_RunDLL',SW_SHOW);
  • Delete a running exe

    This article demonstrates how an exe can delete itself.Under Win32, unless you are running from a removable drive, you cannot delete a running executable. You can have...
  • Show display properties

    This article demonstrates how to show the Display-Properties form of windows.WinExec('rundll32 shell32.dll,Control_RunDLL desk.cpl,,0',SW_SHOW);
  • Path of my DLL

    This article demonstrates how to determine the filepath of a DLL from within the DLL.var Buffer : Array[0..MAX_PATH] of char; begin ...
  • Enable / disable windows start button

    This article demonstrates how to enable / disable the windows start button.To enable: EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil),...
  • Don't minimize secondary forms

    This article demonstrates how to stop all forms in a Delphi app from minimizing when the main form minimizes.For each child form that you wish to remain visible do...
  • How To hog the CPU

    This article demonstrates how to assign more / less CPU time to your Delphi application.var   H: THandle; begin   H := GetCurrentProcess();   SetPriorityClass(H,...
  • CD is audio ?

    This article demonstrates how to determine if the CD inserted is an audio CD or not.procedure TForm1.Button1Click(Sender: TObject); var MyDeviceID : MCIDEVICEID; ...