<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Windows Programming on kenji.blog</title><link>http://kenji.blog/en/tags/windows-programming/</link><description>Recent content in Windows Programming on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>kenjinote</copyright><lastBuildDate>Fri, 19 Apr 2024 01:55:17 +0900</lastBuildDate><atom:link href="http://kenji.blog/en/tags/windows-programming/index.xml" rel="self" type="application/rss+xml"/><item><title>LoadIcon Does Not Need to Call DestroyIcon</title><link>http://kenji.blog/en/p/loadicon%E3%81%AFdestroyicon%E3%82%92%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E5%BF%85%E8%A6%81%E3%81%AF%E3%81%AA%E3%81%84/</link><pubDate>Fri, 19 Apr 2024 01:55:17 +0900</pubDate><guid>http://kenji.blog/en/p/loadicon%E3%81%AFdestroyicon%E3%82%92%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E5%BF%85%E8%A6%81%E3%81%AF%E3%81%AA%E3%81%84/</guid><description>&lt;h1 id="about-the-need-to-call-destroyicon">About the Need to Call DestroyIcon
&lt;/h1>&lt;p>You need to call DestroyIcon in the following cases:&lt;/p>
&lt;ul>
&lt;li>CreateIconFromResourceEx (when called without the LR_SHARED flag)&lt;/li>
&lt;li>CreateIconIndirect&lt;/li>
&lt;li>CopyIcon&lt;/li>
&lt;/ul>
&lt;p>When created with the above functions.&lt;/p>
&lt;ul>
&lt;li>LoadIcon&lt;/li>
&lt;li>LoadImage (when using the LR_SHARED flag)&lt;/li>
&lt;li>CopyImage (when using the LR_COPYRETURNORG flag and the hImage parameter is a shared icon)&lt;/li>
&lt;li>CreateIconFromResource&lt;/li>
&lt;li>CreateIconFromResourceEx (when using the LR_SHARED flag)&lt;/li>
&lt;/ul>
&lt;p>You must not call DestroyIcon for icons created and loaded in the above cases.&lt;/p>
&lt;h3 id="references">References
&lt;/h3>&lt;ul>
&lt;li>&lt;a class="link" href="https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroyicon" target="_blank" rel="noopener"
>DestroyIcon function (winuser.h)&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>