More Programming Articles Page 11

  • 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...
  • 256bit Keys For Strong Encryption

    Techniques for identifying keys that resist brute-force and dictionary attacks. Includes Delphi source for analyzing keys, converting passphrases to keys and permuting...
  • Simplified server-side processing

    RPM simplifies server-side processing for Delphi developersThis article originally appeared in InfoWorld Magazine Copyright InfoWorld Media Group, Inc. Think...
  • 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>
  • 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...
  • Meta refresh example

    How to have your page automatically refresh to another page.Look in your HTML source. <HTML>   <HEAD>     ** HERE **   </HEAD> </HTML>...
  • 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...
  • 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 ...
  • 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...
  • 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,...