0

I am in a scenario where I want to determine where the mouse cursor is when the mouse left button up is done on a Window's non client area (header). For this I am listening for the WM_NCLBUTTONUP and WM_NCLBUTTONDOWN messages of the Window. The issue is that I am only getting the WM_NCLBUTTONDOWN message.

Is there a reason why the Up message is not raised?

On a side note, why I am doing the above is to resolve an issue when the Window is being snapped to the right or the left of the work area. If there is an easier way of getting and "event" when a Window is snapped to the left or right please let me know.

Vladimir Amiorkov
  • 2,652
  • 3
  • 17
  • 35
  • I'd assume it has something to do with this line in the reference " If a window has captured the mouse, this message is not posted." This thread might help though http://stackoverflow.com/questions/9321549/handling-aerosnap-message-in-wndproc – rmn36 Aug 31 '15 at 13:54
  • That is what I also tough and was hoping someone would know if this could be handled or is impossible. This is the first time I am working with the "non client area" of WPF Window's and I am a bit lost. – Vladimir Amiorkov Aug 31 '15 at 14:01
  • On second reading I noticed that the same text "If a window has captured the mouse, this message is not posted." is both present in the WM_NCLBUTTONDOWN and WM_NCLBUTTONUP messages. Isn't it strange that only the up would experience the capture issue, if that is the issue tho. – Vladimir Amiorkov Aug 31 '15 at 14:05
  • Also in the WM_NCLBUTTONDOWN message the IsMouseCaptured of the Window is false. – Vladimir Amiorkov Aug 31 '15 at 14:09

0 Answers0