<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Win32 API on bradleycarey.com</title>
    <link>https://bradleycarey.com/tags/win32-api/</link>
    <description>Recent content in Win32 API on bradleycarey.com</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 05 Dec 2023 14:05:41 -0500</lastBuildDate>
    <atom:link href="https://bradleycarey.com/tags/win32-api/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Window Minimize / Maximize Event (C# winforms)</title>
      <link>https://bradleycarey.com/posts/2012-08-13-window-minimize-maximize-event-c-winforms/</link>
      <pubDate>Mon, 13 Aug 2012 09:58:34 -0400</pubDate>
      <guid>https://bradleycarey.com/posts/2012-08-13-window-minimize-maximize-event-c-winforms/</guid>
      <description>&lt;p&gt;If you are working in C# winforms and need to respond to window minimize and maximize events, it seems that winforms does not provide native event handlers. Such a feat is still very much possible through hooking into the Windows API.&lt;/p&gt;&#xA;&lt;p&gt;The exact message you need to catch is &lt;a href=&#34;http://msdn.microsoft.com/en-us/library/windows/desktop/ms646360%28v=vs.85%29.aspx&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;WM_SYSCOMMAND&lt;/a&gt; and look for the SC_* messages:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;SC_CLOSE 0xF060&lt;/li&gt;&#xA;&lt;li&gt;SC_MAXIMIZE 0xF030&lt;/li&gt;&#xA;&lt;li&gt;SC_MINIMIZE 0xF020&lt;/li&gt;&#xA;&lt;li&gt;SC_RESTORE 0xF120&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;There are indeed more messages. Check the above link for a full list. Now for some sample code:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
