Note that there are some explanatory texts on larger screens.

plurals
  1. PONot receiving WM_NCMBUTTONDOWN on title bar
    text
    copied!<p>I am trying to create a mechanism to allow the user to right click and drag on a toolbar in order to move a window...</p> <p>This is proving very difficult:</p> <p>I am currently not receiving the HTCAPTION event which I have seen a really helpful post for already!</p> <p><a href="https://stackoverflow.com/questions/3631831/not-receiving-wm-nchittest-on-title-bar">Not receiving WM_NCHitTest on title bar</a></p> <p>The suggestion/alternative here is to use the WMNCMouseMove and inspect the HitTest to see if it is the caption.. So naively I assumed that I could extend this idea to use the WMNCMButtonDown (instead) to take me one step closer!</p> <p>If this worked then I could get the type of click i.e. left, right, middle, double or single! This would have then allow me to somehow tell windows that I want this to be recognised as a drag event.</p> <p>The trouble is that I never receive the WM_NCMBUTTONDOW:</p> <pre><code>void __fastcall TForm1::Dispatch( void* message ) { switch ( static_cast&lt;TMessage*&gt;( message )-&gt;Msg ) { case WM_NCHITTEST: { TWMNCHitTest &amp;Message = *static_cast&lt;TWMNCHitTest*&gt;( message ); WMNCHitTest( Message ); break; } case WM_NCMOUSEMOVE: { TWMNCMouseMove &amp;Message = *static_cast&lt;TWMNCMouseMove*&gt;( message ); WMNCMouseMove( Message ); break; } case WM_NCMBUTTONDOWN: { TWMNCMButtonDown &amp;Message = *static_cast&lt;TWMNCMouseMove*&gt;( message ); WMNCMButtonDown(Message); break; } default: { TForm::Dispatch(message); break; } } } </code></pre> <p>oes anybody have any ideas??</p> <p>It is worth noting that I do in fact receive the other types of messages (WM_NCHITTEST &amp;&amp; WM_NCMOUSEMOVE) so the mechanism is working correctly.</p> <p>Please any ideas would be much appreciated!!</p> <p>Thanks,</p> <p>Joe</p>
 

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