how to refresh system files or repair icons

Hi,

how can I refresh system files or repair icons with winapi like the
freewaretool TweakUI ?

Thanks

Ralf