我要捕捉的是程序运行了,然后比如按Ctrl+Alt,或Ctrl+d 切换到桌面了,
程序存在一个计时器,这时就应该停止计时了,但我的程序还是在正常的Running状态,根本没有调用系统的OnSuspendind,所以无法停止。
需要捕捉的是切换到这个状态,而不是Suspend,请指点.多谢...
Hi,
切换的时候并不是立刻进入suspend状态的。
捕捉这个可以用CoreWindow.Activated事件,在传过来的ActivationState中通过检测Deactive可以判断程序是切出去了。
CoreWindow.Activated参考:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.core.corewindow.activated.aspx
Aaron Xue [MSFT] MSDN Community Support | Feedback to us Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help.