I believe deleting is the same as writing, so disabling write permission should disable deleting.

Look up the SetFileSecurity() function.
This should do the trick.