H
hey777
Unregistered / Unconfirmed
GUEST, unregistred user!
我是这样写的:<br> function ExecApplication(AppName: string): TExecuteResult;<br>var<br> hApp: HWND;<br>begin<br> try<br> hApp := WinExec(PChar(AppName), SW_SHOWNORMAL);<br> result := erSuccess;<br> except<br> result := erFailed;<br> end;<br>end;<br><br>procedure stopApplication(AppName: string);<br>var<br> a: integer;<br> hApp: HWND;<br>begin<br> hApp := FindWindow(nil, PChar(AppName));<br> a := -1;<br> if hApp <> 0 then<br> a := SendMessage(hApp, WM_CLOSE, 0, 0);<br> showmessage(inttostr(a));<br>end;<br><br>但在关闭应用程序时 hApp的返回值为0,这是为什么呢,谢谢:)