[RESOVLED]我的应用程序正在阻止关机 [英] [RESOVLED] my application is blocking shutdown

查看:209
本文介绍了[RESOVLED]我的应用程序正在阻止关机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个在后台运行的应用程序。当我最小化它时,它将出现在任务栏上。它工作正常,但当我关闭我的电脑时,Windows说我的应用程序阻止了关机过程。当我关闭电脑时如何关闭我的应用程序?

i使用vs2013开发它并在Windows XP计算机上发布。



我尝试过:



通过互联网查找答案,这是我第一次打包这个。

i have created an application that runs in background. when i minimize it, it will appear on the task bar. it is working fine, but when i turn off my computer, windows says that my application is blocking the shut down process. how do i close my application when i shut down my computer?
i developed it using vs2013 and published it on windows XP computer.

What I have tried:

finding answer over the internet, this is my first time to encouter this.

推荐答案

有一定的谈判操作系统尝试关闭时,Os和您的应用程序之间的(消息)...

操作系统实际上向您的应用程序发送了WM_QUERYENDSESSION,但是由于您没有处理它,它得到了错误的响应,标记您的应用程序是阻止...

阅读本文,了解如何准备您的应用程序在关闭过程中正确播放:

应用程序指南(Windows) [ ^ ]
There are certain talks (messages) between the Os and your application while OS try to shut down...
OS actually sent a WM_QUERYENDSESSION to your application, but as you didn't handled it it got a false response, marking your application as blocking...
Read this paper, to see how prepare your application to properly play during shut down process:
Guidelines for Applications (Windows)[^]


我已经通过添加此鳕鱼来解决它e在我的主表单的form_closing事件期间。

如果e.CloseReason = CloseReason.WindowsShutDown然后Me.Dispose
i have already resolved it by adding this code during form_closing event of my main form.
If e.CloseReason = CloseReason.WindowsShutDown Then Me.Dispose


这篇关于[RESOVLED]我的应用程序正在阻止关机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆