0
如何讓特定事件觸發時我的WPF
應用程序閒置?應用程序空閒
void SystemEvents_SessionSwitch(object sender, Microsoft.Win32.SessionSwitchEventArgs e)
{
if (e.Reason == SessionSwitchReason.SessionLock) {
//make application idle
}
else if (e.Reason == SessionSwitchReason.SessionUnlock) {
//run the app again
}
}
我有我的代碼是這樣的,當用戶鎖定Windows時,如果條件被觸發,當他解鎖它,否則會被解僱。
有人可以建議我讓應用程序閒置並再次運行它的代碼?
你是什麼意思「讓應用程序空閒」?只要沒有做任何事,你的應用程序*就會閒置。 –