How to Determine if There is Anything in the Clipboard

Posted December 15th @ 9:02 pm by m3Rlin

When creating a text editor (or any other kind of program that uses the Clipboard you always insert code to determine if there is anything to copy or cut and to update the menus. Well, you should also do this for the paste function. The whole idea is based on Windows messages and is very [...]

How to Get the Windows System Directory

Posted December 15th @ 6:56 pm by m3Rlin

To found out the name of the Windows directory it’s best to use the Windows API GetSystemDirectory() function.
Here’s the Delphi implementation:

uses Windows;

function GetSystemDir: string;
const
(* The length of the directory buffer. Usually 64 or even 16 is enough
**
** Must be DWORD type.
*)
dwLength: DWORD = 255;
var
psSysDir: PChar;
begin
GetMem(psSysDir, dwLength);
GetSystemDirectory(psSysDir, [...]

« Previous Entries