SDK里面有个结构类型<br>tmousehookstrcut=packed record<br> pt:tpoint; 鼠标光标的屏幕坐标<br> hwnd:hwnd; 接受消息的窗口 这里你或许可以指定其他窗口吧.<br> whittestcod:unit; HIT DE的值<br> dwextrainfo:dword; 消息自定义信息.<br>end;<br>参阅wh_cat钩子函数有对此数据结构更详细的解释.<br>var <br> themessage:tmsg;<br>mouseclicked:boolean;<br>while not mouseclicked do <br>begin<br> while peekmesssage(themessage,handle,0,0,pm_remove) do;<br>waitmessage();<br>peekmessage(themessage,hande,0,0,pm_remove);设置HANDLE指向其他窗体或对象<br>if themessage.message=wm_lbuttondown then<br>begin <br>mouseclicked:=true;<br>showmessage(' a message was received');<br>end;<br>end;<br>end;