★★★取指定点的控件句柄:<br><br>function GetWindowFromPoint(const p: TPoint): HWND;<br>var<br> pp: TPoint;<br> h: HWND;<br> bEnd: Boolean;<br>begin<br> bEnd := False;<br> Result := WindowFromPoint(p);<br><br> while not bEnd do<br> begin <br> pp := p;<br> Windows.ScreenToClient(Result, pp);<br> h := ChildWindowFromPoint(Result, pp);<br> if (h <= 0) or (h = Result) then bEnd := True else Result := h;<br> end;<br>end;<br><br>在鼠标钩子中检测到鼠标消息后调用这个方法即可。<br><br>关于鼠标钩子,可以看看这个帖子:<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=1883318<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=1850588<br>