例如点击窗口上的一个按钮的调用过程:TForm1.Button1Click(???)
TControl.Click
TButton.Click
TButton.CNCommand((48401, 414, 0, 2097566, 0))
TControl.WndProc((48401, 414, 2097566, 0, 414, 0, 414, 32, 0, 0))
TWinControl.WndProc((48401, 414, 2097566, 0, 414, 0, 414, 32, 0, 0))
TButtonControl.WndProc((48401, 414, 2097566, 0, 414, 0, 414, 32, 0, 0))
TControl.Perform(48401,414,2097566)
DoControlMsg(2097566,(no value))
TWinControl.WMCommand((273, 414, 0, 2097566, 0))
TCustomForm.WMCommand((273, 414, 0, 2097566, 0))
TControl.WndProc((273, 414, 2097566, 0, 414, 0, 414, 32, 0, 0))
TWinControl.WndProc((273, 414, 2097566, 0, 414, 0, 414, 32, 0, 0))
TCustomForm.WndProc((273, 414, 2097566, 0, 414, 0, 414, 32, 0, 0))
TWinControl.MainWndProc((273, 414, 2097566, 0, 414, 0, 414, 32, 0, 0))
StdWndProc(1835476,273,414,2097566)
TWinControl.DefaultHandler((no value))
TControl.WMLButtonUp((514, 0, 27, 9, (27, 9), 0))
TControl.WndProc((514, 0, 589851, 0, 0, 0, 27, 9, 0, 0))
TWinControl.WndProc((514, 0, 589851, 0, 0, 0, 27, 9, 0, 0))
TButtonControl.WndProc((514, 0, 589851, 0, 0, 0, 27, 9, 0, 0))
TWinControl.MainWndProc((514, 0, 589851, 0, 0, 0, 27, 9, 0, 0))
StdWndProc(2097566,514,0,589851)
TApplication.ProcessMessage((2097566, 514, 0, 589851, 4794281, (609, 279)))
TApplication.HandleMessage
TApplication.Run
Project1通过观察上面是没有WM_LBUTTONDOWN事件的。反而是触发按钮所属的窗口的WM_LBUTTONDOWN事件。

解决方案 »

  1.   

    你得到的數據有誤。
    用winsight32查看(把不必要的消息過濾掉),你點擊一個按鈕,form會收到wm_command, button會收up and down的消息
      

  2.   

    你这是在Button的OnClick中设置断点出来的结果嘛!你在Button的OnMouseDown中设置断点再调出堆栈窗口就看到了WM_LBUTTONDOWN/WM_RBUTTONDOWN的消息处理流程了。
      

  3.   

    还设什么断点.onclick是鼠标up时触发的事件. down事件早发生过了. 当然看不到.
      

  4.   

    不可能没有Down事件
    一个Click是由Down和Up两个消息组成不知道楼主是用什么方法获得这个东西的
    建议楼主使用Spy++查一下,消息就知道了,肯定会有Down消息的
      

  5.   

    先有Down事件,之后才有up事件的
      

  6.   

    form的keypreview=true
    在Control按下前先触发form的keydown
    无论如何keydown是有的