如何禁用挂起 ||结束 ||我的 Metro Style App 在 Windows 8 Pro 上的终止事件我的、挂起、结束、事件

2023-09-06 14:16:04 作者:你是年少的欢喜

我是一名法国开发人员,我需要为始终启动的 Windows 8 Pro 开发 Metro Style 应用程序.我想知道如何禁用我的应用程序的关闭事件.我的应用需要一直在前面,用户无法退出应用.

I'm a french developer and I need to develop an Metro Style app for Windows 8 Pro who is always launched. I wanted to know how can I disable the close event of my app. My app need to be in front all the time and the user couldn't quit the app.

我以为我可以使用 GPO 禁用所有快捷方式,但关闭手势(将应用从顶部拖到底部)也需要我禁用.

I thought I could disable all the shortcut with the GPO but the close gesture (drag the app from the top to the bottom) need to me disabled too.

我希望我很清楚,每个人都会理解这个问题:-).请随时问我更具体的问题.

I hope I was clear and everybody will understand the question :-). Feel free to ask me more specific questions.

诚挚的雷诺.

推荐答案

简短的回答是:你不能.

The short answer is: You can't.

操作系统和用户控制 Metro Style 应用程序的生命周期,您不能阻止用户切换离开您的应用程序,一旦您的应用程序不再处于前台,应用程序将暂停并且系统可以终止随时申请.

The operating system and the user control the lifetime of Metro Style apps, you can't block the user from switching away from your app and once your app is no longer in the foreground, the application is suspended and the system can terminate the application at any moment.

同样,用户关闭手势也不能被阻止.

Similarly, the user close gesture cannot be blocked.