how to refresh system files or repair icons

Hi,

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

Thanks a lot

Ralf