Y
yexiaoming
Unregistered / Unconfirmed
GUEST, unregistred user!
程序如下,请大富翁们指教如何改正。<br> Handle := FindWindow('Tmainform', 'test'); <br> if Handle <> 0 then<br> begin<br> 。。。。查找别一程序的窗体句柄<br> BtnHandle := Handle;//已取得按钮句柄<br> //SendMessage(FButtonHandle, WM_LBUTTONDOWN, 0, 0);<br> //SendMessage(FButtonHandle, WM_LBUTTONUP, 0, 0);<br> PostMessage(FButtonHandle, WM_LBUTTONDOWN, 0, 0);<br> PostMessage(FButtonHandle, WM_LBUTTONUP, 0, 0);<br> //注:改成PostMessage可以跳过<br> //模拟点击另一程序,结果为别一程序弹出对话框,本程序就在此句停住,<br> //不能执行下一句模拟点击另一程序对话框的程序。<br> Handle := FindWindow('Tform1', 'test'); //对话框窗口查找不到正确的句柄,重点<br> if Handle <> 0 then<br> 。。。。。。。。。。。。。<br>end;