How to detect whether copying to USB stick is finished

We are using WEC7 on Apalis board and programming in C with VisualStudio 2008.
On our HMI we have the availability to backup \flashdisk to USB stick (many files). Sometimes the operators remove the USB-stick immediately after our last CopyFile. In this situation not all data are stored on USB stick and sometimes we get corrupted files on it.

Is there way to detect whether USB stick has finished operation and is ready to be removed ?

I did not get this information via RequestDeviceNotifications but maybe there is some IOCTL ?

Any thoughts appreciated. Thanks !

You can use the CopyFileEx() instead of CopyFile and track completion by its LPPROGRESS_ROUTINE.