*---------------------- Location Section ------------------------ * Library: Iconbuddy.vcx * Class: Iconbuddy * Method: Createtmpiconfile() *----------------------- Usage Section -------------------------- *) Description: *) * Scope: Public * Parameters: tcFile *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 08/30/2005 - NN (Frank Dietrich) * MODIFIED *---------------------------------------------------------------- lparameters tcFile as string, tcFileType as string local lcExtension, loItem, lcIconFile, lcOutFile, ; lcOutStem, loIconLarge, loIconSmall, lnIconsFound, lcTempPath *-- Get the extension of the given file lcExtension = lower(justext(tcFile)) *-- and see if we already have an icon for it lcIconFile = this.GetIconFile(lcExtension) if empty(lcIconFile) *-- Not in the collection yet loItem = createobject("EMPTY") addproperty(loItem, "cIconLarge", "") addproperty(loItem, "cIconSmall", "") addproperty(loItem, "cFileType", "") *-- now extract the icons for the filetype loIconLarge = .null. loIconSmall = .null. lnIconsFound = this.GetAssocIconPairObjects(tcFile, @loIconLarge, @loIconSmall) lcTempPath = addbs(Fn2Lfn(sys(2023))) if lnIconsFound = 2 *-- Save the IconObject to disk lcOutStem = "ICN"+ sys(2015) lcOutFile = lcTempPath + lcOutStem + "_L.ICO" ** we don't have Save2File method implemented * this.Save2File( loIconLarge, lcOutFile ) = savepicture(loIconLarge, lcOutFile) *-- and keep for further reference loItem.cIconLarge = lcOutFile *-- and do the same with the small icon lcOutFile = lcTempPath + lcOutStem + "_S.ICO" * this.Save2File( loIconSmall, lcOutFile ) = savepicture(loIconSmall, lcOutFile) *-- and keep for further reference loItem.cIconSmall = lcOutFile loItem.cFileType = this.cFileType endif *-- ... and add the Item to the Collection this.oIcons.add( loItem, lcExtension ) endif return