X
xiechong
Unregistered / Unconfirmed
GUEST, unregistred user!
var<br> H: HWND;<br>begin<br> H := FindWindow('TfrmMain', nil);<br> if H <> 0 then<br> begin<br> MessageBox(0, '该程序已经有一个在运行中!', '运行', 0);<br> Application.Terminate;<br> end;<br><br> Application.Initialize;<br> Application.CreateForm(TfrmMain, frmMain);<br> Application.Run;<br>end.<br><br>改用 H := FindWindow(nil, '窗口名称')也一样