By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,805 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,805 IT Pros & Developers. It's quick & easy.

Can't shut down while appl is running

P: n/a
Hi,
I have a application developed by me in C# that does not let windows shut
down!

What is the problem? is this a Framework bug?

I would like to receive some feedback about this issue
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hello

It does not let windows to shut down at all?

Usually, Windows is sending a message to each application indicating that
the system is going down. Each application has a chance to make something
(save some data, for example) before shut down. For some applications it can
be a rather slow process, an application can even ask a user something (save
data or not). So, try to check your application. Are there any actions
performed on application close which slower shut down or even pause it
waiting some action from user ?


--
With best regards,
Andrew

http://www.codeproject.com/script/pr...asp?id=1181072
"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:35**********************************@microsof t.com...
Hi,
I have a application developed by me in C# that does not let windows shut
down!

What is the problem? is this a Framework bug?

I would like to receive some feedback about this issue

Nov 17 '05 #2

P: n/a
You mean that windows app stays in the process list of the task manager, if
so probably there are not closed/disposed resources in the application.

If you use resources ( e.g. unmanaged ) then in the form's Dispose you have
to close/dispose them.

If you will give more description about the app you're developing or what
that app is using, the answer can be given much more faster...

--
Vadym Stetsyak aka Vadmyst

"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:35**********************************@microsof t.com...
Hi,
I have a application developed by me in C# that does not let windows shut
down!

What is the problem? is this a Framework bug?

I would like to receive some feedback about this issue

Nov 17 '05 #3

P: n/a
The problem was solved with this ;)

protected override void WndProc(ref Message m)
{
int WM_QUERYENDSESSION = 0x11;
int WM_ENDSESSION = 0x16;
// Carry on with the message.
base.WndProc(ref m);
if (m.Msg == WM_QUERYENDSESSION)
{
m.Result = (IntPtr) 1;
}
else if (m.Msg == WM_ENDSESSION)
{
m.Result = (IntPtr) 0;
this.Close();
}
}

"Vadym Stetsyak" wrote:
You mean that windows app stays in the process list of the task manager, if
so probably there are not closed/disposed resources in the application.

If you use resources ( e.g. unmanaged ) then in the form's Dispose you have
to close/dispose them.

If you will give more description about the app you're developing or what
that app is using, the answer can be given much more faster...

--
Vadym Stetsyak aka Vadmyst

"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:35**********************************@microsof t.com...
Hi,
I have a application developed by me in C# that does not let windows shut
down!

What is the problem? is this a Framework bug?

I would like to receive some feedback about this issue


Nov 17 '05 #4

P: n/a
Hi,

Frankly I see no motive why you have to put this, the default WndProc should
have a code similar to yours, are you using threads? or maybe using a modal
dialog box ? I run ICQ from time to time and it does the same thing, when
windows is shutting down it display a message asking if I want to close
before answer the messages, it does prevent windows from shutting down, bad
app design, that's all

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:21**********************************@microsof t.com...
The problem was solved with this ;)

protected override void WndProc(ref Message m)
{
int WM_QUERYENDSESSION = 0x11;
int WM_ENDSESSION = 0x16;
// Carry on with the message.
base.WndProc(ref m);
if (m.Msg == WM_QUERYENDSESSION)
{
m.Result = (IntPtr) 1;
}
else if (m.Msg == WM_ENDSESSION)
{
m.Result = (IntPtr) 0;
this.Close();
}
}

"Vadym Stetsyak" wrote:
You mean that windows app stays in the process list of the task manager,
if
so probably there are not closed/disposed resources in the application.

If you use resources ( e.g. unmanaged ) then in the form's Dispose you
have
to close/dispose them.

If you will give more description about the app you're developing or what
that app is using, the answer can be given much more faster...

--
Vadym Stetsyak aka Vadmyst

"Diogo Alves - Software Developer"
<Di*************************@discussions.microsoft .com> wrote in message
news:35**********************************@microsof t.com...
> Hi,
> I have a application developed by me in C# that does not let windows
> shut
> down!
>
> What is the problem? is this a Framework bug?
>
> I would like to receive some feedback about this issue


Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.