<<windows程序设计>>中讲到此消息优先于所有的其它的客户区和非客户区鼠标消息.windows应用程序通常把这个消息传递给DefWindowProc,然后windows用WM_NCHTTEST消息产生基于鼠标位置的所有其它鼠标消息.我想问的是当一个鼠标有动作时,它是不是总先去产生这个消息,然后windows先去处理这个消息,用这个消息的处理结果再去产生接下来需要真正用户处理的鼠标消息呀?这个消息和别的消息之间到底是什么关系?它们之间是怎么相互协调工作的?

解决方案 »

  1.   

    你写一个它的响应函数就明白了。
    这个消息只在你的mouse在标题标上停留时会触发。
    (呵!可能用在让maxwindow,restorewindow,closewindow按钮实现tooltips吧!谁知道呢?)
      

  2.   

    The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouseThe WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.从字面意思看WM_NCHITTEST在WM_LBUTTONDOWN和UP、WM_MOUSEMOVE前到达,你可以响应鼠标消息,打印一下好了WM_LBUTTONUPThe WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse
      

  3.   

    是总产生这个消息,因为WIN是要处理WM_NCHITTEST消息,并使用光标坐标来确定光标所在窗口上的位置,然后再产生一个客户区或非客户区鼠标消息.
      

  4.   

    那就是说每个其它的鼠标消息触发之前,都是先由系统发送一个WM_NCHITTEST消息,然后再处理将要处理的那个鼠标消息吧.