How to Get a Unique File Name

Posted December 15th @ 9:24 pm by m3Rlin

You want to save data to a temporary file but you don’t what to file name to use? Well, this function does all the work for you.

function CreateUniqueFileName(sPath: string): string;
var
chTemp: Char;
begin
repeat
Randomize;
repeat
chTemp := Chr(Random(43) + 47);
[...]

How to Determine the Screen Resolution

Posted December 15th @ 9:14 pm by m3Rlin

There are two ways to determine the screen’s height and width.
1) Use the global Screen variable.

uses
Forms;

Screen.Height { Screen height in pixels }
Screen.Width { Screen width in pixels }

2) Use the Windows API GetSystemMetrics() function. This function can be useful in applications that don’t use the VCL like [...]

« Previous Entries