More Programming Articles Page 11

  • Visual SlickEdit 5.0

    Visual SlickEdit 5.0 takes a bite out of development timeThis article originally appeared in InfoWorld Magazine Copyright InfoWorld Media Group, Inc. If you're...
  • Cryptographic Random Numbers

    Explanation with Dephi source explaining how to generate random numbers with proper sources of entropy and hash functions. [Cryptographic Random Numbers] //Source Code...
  • Cracking XOR Encryption

    Source code example of how to break encryption using Delphi's random() function and XOR.[Cracking XOR Encryption] drop a button and edit box on the form, text in the...
  • Protecting Your Software

    Reverse-engineering protection (built-in and active) Protecting Your Software All programs involved in security present vulnerabilities; it is up to the programmers...
  • Key Database

    Database structure that allows you to securly store keys together with descriptions and other attributes. Key Database The main reason for using key databases is the...
  • Highlight words by clicking them

    How to highlight words by clicking them, and have the list of highlighted words placed into a hidden INPUT within a FORM.<html> <head>   <script...
  • Reading and writing a file to and from a string

    This article inroduces two handy functions for reading the contens of a file in a string and writing a string to a file.Reading a file into a string Perhaps the...
  • Getting the associated icon of a file extension

    This article introduces a function you can use to get the associated icon of a file or document based on its file extension (i.e. it doesn't matter if the file or...
  • Highlighting table cells

    How to highlight cells in a tablefunction changeto(highlightcolor){ source=event.srcElement if (source.tagName=="TR"||source.tagName=="TABLE")...
  • Days since last change

    How long since this page was last altered.<script language=JavaScript>  <!-- Hide  /* This JavaScript is composed by Bart Van Hemelen.  * You can contact...
  • Starting an application as an icon in the system tray

    This article will show you how to start an applicacion minimized with an icon in the system tray (the area at the right of the task bar)PLACING AN ICON IN THE SYSTEM...
  • Making an application run automatically when Windows starts

    Delphi Borland Windows application run automatically start starts startupOne way is placing a direct access to the application in the Startup folder of Windows Start...
  • Accessing the Windows Registry

    This article introduces a couple of handy functions that make it easy to read and write values in the Windows Registry.WHAT IS THE REGISTRY? It is where Windows stores...
  • Determining the associated application

    Knowing the application associated with a given file extension.WHERE IS THAT INFORMATION? The applications associated with the file extensions are stored in the...
  • Disable right mouse button

    No right clicking please !<script language="JavaScript1.2"> if (document.all) document.body.onmousedown=new Function("if...
  • Print another page

    When the user prints the page, actually print another page.<head> <link rel=alternate media=print href="http://www.microsoft.com"> </head>
  • Meta refresh example

    How to have your page automatically refresh to another page.Look in your HTML source. <HTML>   <HEAD>     ** HERE **   </HEAD> </HTML>...
  • Creating Office menus

    How to Create Office like menu ? Drop down a TControlBar or a TCoolbar. Drop down a TToolBar inside of the TcontrolBar or TCoolbar. Set Flat, and ShowCaptions of the...
  • Moving menus

    How to move a menu ?// The line that follows switch « New » with « Open » in the file menu // Items[0] identifies the first « main » menu (File) // [1]...
  • Menu to the right of the window

    Is the menu to the right of the window ?var MENUITEMINFO: TMENUITEMINFO; Buffer: array[0..79] of Char; // declared in menu.pas. I wonder why 79. begin ...
  • Checked menu items

    How to use my own checkmark for menuitems ?// Use GetSystemMetrics with CXMENUCHECK and CYMENUCHECK to get the size of menu checkmarks ...
  • How do I programmatically drop down a menu ?

    How to drop down a menu through code rather than user interaction. {Alt Key Down} keybd_Event(VK_MENU, 0, 0, 0); {F Key Down - Drops the menu down} ...
  • Disabling system menus

    Disabling/Enabling system menu or minimize/maximize/close button at run-time// Disable BorderIcons := BorderIcons - [biSystemMenu, biMinimize, biMaximize]; // Enable...
  • Is menu open

    How to check if a menu is dropped down or not.type TForm1 = class(TForm) ... private IsMenuOpen: Boolean; procedure WMMENUSELECT(var message: TWMMENUSELECT);...
  • Create and add an menuitem at runtime

    How to create and add a menuitem at runtime ?type TForm1 = class(TForm) ... private procedure MenuClick(Sender: TObject); ... NewMenu := TMenuItem.Create(nil);...
  • How To add items to the system menu

    How to add items to the system menu at the top left of the form.type   TForm1 = class(TForm)   ...     procedure FormCreate(Sender: TObject);   private...
  • Ownerdrawn menu

    Ownerdrawn menusChange the ownerdraw property of the TMainMenu to True, then for each TMenuItem you want to custom draw mess with OnDrawItem and OnMeasureItem....
  • Dynamic popup menus

    How to dynamically update items of popupmenu ?type TForm1 = class(TForm) PopupMenu1: TPopupMenu; ... procedure FormMouseDown(Sender: TObject; Button:...
  • Is popup menu open ?

    Is popup menu open ?Using the WM_MENUSELECT message of the form won't work to check if the popup is open. Simply because the parent of the popup is not the form (check...
  • Hints for menu items

    How can I create hints for Menu items?On your form, we assume you have a MainMenu and a Statusbar type TForm1 = class(TForm) ... procedure FormCreate(Sender:...
  • Long and short hints.

    What is a long/short hint ?When you set the hint property of a component, you can create it in two parts : The short part|The part that can be longer If you set the...
  • Get client IP

    When creating forums, tagwalls and the like it is important to save the IP of the user in case of abuse.Simply insert the following code: IP =...
  • Disable CD AutoRun

    This is an example of how to enable / disable the CD autorun for windows.// declare Registry in your USES clause procedure SetCDAutoRun(AAutoRun:Boolean); const ...
  • RDB$FOREIGN1

    Interbase generates very unfriendly names for constraints. This is a script that will make it generate more friendly ones./* SUGGESTION ABOUT HOW TO CONTROL THE NAMES...
  • Restricting access to the USERS table

    Any user can log in to ISC4.GDB and manipulate data in the USERS table. Here is how to prevent this./* Enhanced security database (isc4.gdb) - version B -it...
  • Populate a dropdown selectbox from DB

    Dynamically populate a dropdown select from a database with unique data. <!--- Select ID & Brand using Distinct to make sure there are no duplicates in the...
  • 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...