Hi xandaz,
Here is an example based on OleCreatePictureIndirect :
mov hLib,eax
invoke LoadIcon,eax,100
mov hIcon,eax
mov pd.cbSizeofstruct,SIZEOF PICTDESC ; initialize the PICTDESC structure
mov pd.picType,PICTYPE_ICON
push hIcon
pop pd.icon.hicon
invoke OleCreatePictureIndirect,ADDR pd,ADDR IID_IPicture,TRUE,ADDR pBitmap
; create the OLE image
invoke CreateStreamOnHGlobal,NULL,TRUE,ADDR pStream
; create the destination stream to save the icon
coinvoke pBitmap,IPicture,SaveAsFile,pStream,TRUE,OFFSET pcbSize
invoke GetHGlobalFromStream,pStream,ADDR hGlobal
invoke GlobalLock,hGlobal ; get the address pointing the icon in memory
invoke WriteFileToDisc,ADDR IconName,eax,pcbSize
; write the icon to disc
coinvoke pBitmap,IPicture,Release
coinvoke pStream,IStream,Release
invoke FreeLibrary,hLib