473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can't shut down while appl is running

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
4 2215
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Metzger | last post by:
I've been running an Access2000 database for a couple years on a Win2k machine fine. We tried to copy the database over to another machine that already had Access2000 installed. When we tried to...
13
by: Bredal Jensen | last post by:
I'm thinking of soething equivalent to "exitwindows"
4
by: Claire | last post by:
Running XP pro, SP2. Visual studio .NET 2003. App written in C# I have written an application that hides itself when run and shows a notification icon in the system tray. If the main form is...
3
by: BrianDH | last post by:
Hi I have a VB.Net windows application that for some reason when running will not allow the user to shut-down/reboot the Operating System without first closing my application. Has anyone had the...
8
by: Austen | last post by:
Hello i trying to shut down window using vb. i able to restart and log off, but was unable to shut down. when excute the shut down command , nothing happend. it related to window os security issue?
5
by: jbenner | last post by:
I have opened a PMR for this with IBM, and am not asking for advice from the DB2 DBA community. I am posting this as an FYI that DB2 Health Monitor, even at the latest version of DB2, still can cause...
3
by: mturner64 | last post by:
I have heard arguments from both sides of the field. Some prefer to shut down daily and others prefer to leave computers running and only shut them down to re-boot a few times per month. What are...
2
by: =?Utf-8?B?R2xlbm4=?= | last post by:
i just upgraded from XP to Vista and so far am kicking myself for it. After I installed and got all my drivers updated i went to shut down windows and it will not shut down. It closes all programs...
5
by: Sheena777 | last post by:
I have a program that I have created and that is permanently running in the back ground on a user's PC. This program is used to check if a finger print scanner is on and if not it will be restarted...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.