procedure TfrmMain.BtntestClick(Sender: TObject);<br>var<br> TargetWin:Hwnd;<br> btnhwnd:Hwnd;<br>begin<br> TargetWin:=FindWindow(nil,'Form1');<br> if TargetWin= 0 then exit;<br> btnhwnd:= FindWindowEx(TargetWin,0,'Tbutton','button1');<br> if btnhwnd=0 then exit;<br> sendMessage(btnhwnd,WM_LBUTTONDOWN,0,0);<br> sendMessage(btnhwnd,WM_LBUTTONUP,0,0);<br>end;<br>目标窗体里只有一个按钮 <br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>ShellExecute(0, 'Open', 'IEXPLORE.EXE', 'www.126.com', nil, SW_SHOW); <br>end;<br>这样可以模拟 。 <br>你可以把鼠标限制在某个区域 ,在模拟LBUTTONDOWN,WM_LBUTTONUP 应该可以的<br><br>不行的话 明天在来研究 ,先回家了