Memory Problems (Win32 API function failed)

Hello All

I get a Win 32 API function failed error when my system memory is getting
low.  The problem is that when I run my program from within Delphi it hangs
my PC and I have to Reset it.  I can't seem to trap this error because
there is no memory and it hangs.

How can I manage this, must I find the available memory out before I open
every screen and raise an exception if the memory is lower than a certain
amount.  Why is my program not swapping when the memory is getting low,
like other programs are doing?

If someone could please aswer this, it would be much appreciated.

IST Energy
Tel. (+27 12) 348 8705
Fax. (+27 12) 348 9472