怎么不能用行?(100分)

  • 主题发起人 主题发起人 sdwflzg
  • 开始时间 开始时间
S

sdwflzg

Unregistered / Unconfirmed
GUEST, unregistred user!
Delphi 中关闭“计算器”程序为例: <br>var <br>HWndCalculator : HWnd; <br>begin <br>// find the exist calculator window <br>HWndCalculator := Winprocs.FindWindow(nil, '计算器'); // close the exist Calculator <br>if HWndCalculator &lt;&gt; 0 then <br>SendMessage(HWndCalculator, WM_CLOSE, 0, 0); <br>end; <br>________________________<br>这句为什么不能运行?<br>HWndCalculator := Winprocs.FindWindow(nil, '计算器'); // close the exist Calculator <br><br>
 
这样写就可以了 &nbsp;:??HWndCalculator := FindWindow(nil, '计算器');
 
HWndCalculator := Winprocs.FindWindow(nil, '计算器'); // close the exist Calculator <br>这句话应该改为<br>HWndCalculator := FindWindow(nil, '计算器'); // close the exist Calculator <br>FindWindow是api函数!!!<br><br>var<br>HWndCalculator : HWnd;<br>begin<br>// find the exist calculator window<br>HWndCalculator := FindWindow(nil, '计算器'); // close the exist Calculator<br>if HWndCalculator &lt;&gt; 0 then<br>SendMessage(HWndCalculator, WM_CLOSE, 0, 0);<br>END;<br>
 
接受答案了.
 
后退
顶部