在我的 Windows 应用程序中,当用户单击电源关闭按钮时,我执行以下操作:
void PowerButton_ButtonClicked(object sender)
{
DialogResult dl = MessageBox.Show(Globals.SECUEXIT, Globals.CMD_EXIT, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
if (dl == DialogResult.Cancel)
{
return; //Power off canceled, nothing to do
}
else
{
Program.btConn.send(BtMsg.OFF); //Send the turn off instruction to the BT device.
Program.scr_SplashScreen.exitRequest();
Application.Exit();
}
}
在我的手机上关闭应用程序需要大约 15 秒。我怎样才能加快这个过程?
谢谢 !