<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=97224&amp;view=findpost&amp;p=732793</guid>
        <pubDate>Mon, 30 May 2005 07:18:17 +0000</pubDate>
        <title>Как сохранить иконку в файл имея её хендл</title>
        <link>https://forum.sources.ru/index.php?showtopic=97224&amp;view=findpost&amp;p=732793</link>
        <description><![CDATA[jack128: Проще всего через COM<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">uses</div><div class="code_line">&nbsp;&nbsp;Windows,ActiveX;</div><div class="code_line">&nbsp;</div><div class="code_line">function OleSavePictureFile(dispPicture: IDispatch; bstrFileName: TBStr): HResult; stdcall;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &#39;oleaut32.dll&#39;;</div><div class="code_line">&nbsp;</div><div class="code_line">// icon - дескриптор иконки</div><div class="code_line">// FileName - файл, в который сохранять</div><div class="code_line">// DestroyAfterSave - уничтожать дескриптор иконки после сохранения или нет</div><div class="code_line">function StoreIconFile(icon:HICON; FileName:string; DestroyAfterSave:boolean=false):boolean;</div><div class="code_line">const</div><div class="code_line">&nbsp;IID_IPictureDisp:TGUID = &#39;{7BF80981-BF32-101A-8BBB-00AA00300CAB}&#39;;</div><div class="code_line">var</div><div class="code_line">&nbsp;pd:TPictDesc;</div><div class="code_line">&nbsp;ipd:IPictureDisp;</div><div class="code_line">begin</div><div class="code_line">&nbsp;pd.cbSizeofstruct:=sizeof(TPictDesc);</div><div class="code_line">&nbsp;pd.picType:=PICTYPE_ICON;</div><div class="code_line">&nbsp;pd.hIcon:=icon;</div><div class="code_line">&nbsp;result:=(OleCreatePictureIndirect(pd,IID_IPictureDisp,DestroyAfterSave,ipd)=S_OK) and</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; (OleSavePictureFile(ipd, StringToOLEStr(FileName))=S_OK)</div><div class="code_line">end;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script> <br>
<br>
<strong class='tag-b'>Автор:</strong> <a class='tag-url' href='http://forum.sources.ru/index.php?showuser=12367' target='_blank'>Krid</a><br>
<br>
Ссылка по теме <a class='tag-url' href='http://forum.sources.ru/index.php?showtopic=97226' target='_blank'>Как сохранить иконку в файл имея её хендл</a>]]></description>
        <author>jack128</author>
        <category>ActiveX, COM, DCOM, CORBA, MIDAS, интерфейсы, OLE, DDE</category>
      </item>
	
      </channel>
      </rss>
	