K
kofxdm
Unregistered / Unconfirmed
GUEST, unregistred user!
var<br> mHandle, fHandle: THandle;<br>begin<br> Application.Initialize;<br> Application.Title := '控制中心';<br> Application.HelpFile := '';<br> mHandle := CreateMutex(nil, True, '控制中心');<br> if mHandle <> 0 then <br> begin <br> if GetLastError = ERROR_ALREADY_EXISTS then<br> begin <br> fHandle := FindWindow(PChar('TfrmCenter'), nil);<br> //BringWindowToTop(fHandle);<br> ShowWindow(fHandle, SW_RESTORE );<br> SetForeGroundWindow(fHandle);<br> ReleaseMutex(mHandle);<br> Halt;<br> end;<br> end;<br> Application.CreateForm(TfrmCenter, frmCenter);<br> Application.Run;<br>end.<br>使用上面的代码,程序最小化后,再次执行,这时主窗口恢复原窗口大小,并且置在最前面,但是,此时窗口的最小化按钮不起作用,如何改进?