I\'m using Delphi 2007.
I am copying files to a remote drive. When the copying ends, I shutdown/standby the machine. It can happen that some files don\'t get copied
It depends on the type of disk activity you want to detect.
The language "Delphi" in-and-of itself probably has no libraries to help you with this.
If those don't do it for you then you need to drop down to hooking the operating system calls or more likely the hardware level which usually involves writing a device driver hooking the IDT (Interrupt Descriptor Table). I recommend the book Rootkits for more information.