Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom Min Max Close Button implementation
    primarykey
    data
    text
    <p>I am using plain C++ (without MFC) to implement an application. I wanted to add custom Min/Max/Close button</p> <p>The code below is what I used. For HTCAPTION and other border related definition works like a charm, but I could not get HTMINBUTTON, HTMINBUTTON, HTCLOSE to work in the same way. Is anything else needed to be implemented for the NCHITTEST to take effect?</p> <pre><code>// Defining min/max/close if ((p.x &gt; rt.right - 130) &amp;&amp; (p.x &lt; rt.right - 104) &amp;&amp; (p.y &gt; 41) &amp;&amp; (p.y &lt; 67)) return HTMINBUTTON; else if ((p.x &gt; rt.right - 100) &amp;&amp; (p.x &lt; rt.right - 74) &amp;&amp; (p.y &gt; 41) &amp;&amp; (p.y &lt; 67)) return HTMAXBUTTON; else if ((p.x &gt; rt.right - 70) &amp;&amp; (p.x &lt; rt.right - 44) &amp;&amp; (p.y &gt; 41) &amp;&amp; (p.y &lt; 67)) return HTCLOSE; // Defining window border and caption else if ((p.x &gt; EDGE) &amp;&amp; (p.x &lt; rt.right-EDGE) &amp;&amp; (p.y &gt; EDGE) &amp;&amp; (p.y &lt; rt.bottom-EDGE)) return HTCAPTION; else if (p.x &lt;= EDGE &amp;&amp; p.y &lt;= EDGE) return HTTOPLEFT; else if (p.x &lt;= EDGE &amp;&amp; p.y &gt;= rt.bottom - EDGE) return HTBOTTOMLEFT; else if (p.x &gt;= rt.right - EDGE &amp;&amp; p.y &lt;= EDGE) return HTTOPRIGHT; else if (p.x &gt;= rt.right - EDGE &amp;&amp; p.y &gt;= rt.bottom - EDGE) return HTBOTTOMRIGHT; else if (p.x &lt;= EDGE) return HTLEFT; else if (p.x &gt;= rt.right - EDGE) return HTRIGHT; else if (p.y &lt;= EDGE) return HTTOP; else if (p.y &gt;= rt.top - EDGE) return HTBOTTOM; else return DefWindowProc(hWnd, message, wParam, lParam); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload