can anyone tell me is it possible to extract an icons from the registry

or get an icon from just the extension of the file like .jpg or whatever

how can i do this? please help