29 Sep

Get Process Memory Info

If you want to know how many bytes of memory is using your process, here is simple example.

17 Feb

Detect system font size

The standard system font size in Windows XP is 96 dpi. You can also use 120 dpi, if your prefer bigger fonts or you can set this font size to your own value. However, the most applications today are tested only with standard font size and if you change it, even professional applications can have [...]

06 Jan

Own items in application system menu

When you rightclick application title bar (or leftclick icon on title bar), the system menu will appear. Here are common commands to close, minimize or maximize window. But you can add your own commands if you like. Here is how.

26 Nov

How to locate important system directories

Using ShlObj unit and SHGetSpecialFolderLocation Windows API function, we can retrieve the location of a special folders, such as My computer, Desktop, Program Files etc… There are over 20 special folder locations.

11 Nov

How to detect system idle time

If you want to detect user inactivity even if your application is in background (has no focus), it’s really simple. You can achieve this using GetLastInputInfo function.

18 Aug

Retrieve time since the system was started

This tip is very simple. Just use standard function GetTickCount and the rest is just elementary mathematics.

01 Apr

Global system hotkey

Using the RegisterHotKey function and few other lines of code, you can register a global system hotkey, which is active even if your application is minimized.

25 Mar

How to detect (and prevent) system shutdown

When Windows are being shutdown or restarted, all runnig applications are closed of course. This can be dangerous, because you can lost your unsaved documents. But there is an easy way to detect, that Windows wants to shutdown and your application can do everything necessary to close properly.