In a "sandboxing" question of mine I was pointed to Sandboxie.
I does not solve my problem at all but maybe it is interesting for you?
I don't know if it has an API but a quick google indicates that it is at least somehow automatable via command line.