Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How run the programm before system shutdown?

1 view
Skip to first unread message

Alex Klash

unread,
Aug 20, 2003, 1:45:31 AM8/20/03
to
I need run progamm after user has begun initialize system shutdown and
before system is starting shuwdown process. Can anybody help me, how do it?
OS - Windows 2000 or XP.
Please ansver me to e-mail, if it's posible.

Thank's.


Sreeram

unread,
Aug 20, 2003, 2:08:53 AM8/20/03
to Alex Klash
Hi Alex,

You can handle WM_QUERYENDSESSION which will fire when the system is
shutting down. Are you looking for this information?

Sreeram

Alex Klash

unread,
Aug 20, 2003, 6:32:49 AM8/20/03
to
Hi Sreeram!

O Yes! Thank's!

I mast write like this?

...
case WM_QUERYENDSESSION:
CreateThread ( ......SomeShutDownProc....);
retrun FALSE;
....

SomeShutDownProc(){
........
ExitWindows();

};


"Sreeram" <sreer...@netscape.net> wrote in message
news:3F431075...@netscape.net...

Sreeram

unread,
Aug 20, 2003, 6:47:38 AM8/20/03
to Alex Klash
Hi Alex,

You can write code in OnQueryEndSession fn. which is the message map for
WM_QUERYENDSESSION. This message will fire when the windows is
shutting down or logg of. You don't have to call ExitWindows again.

Sreeram

Alex Klash

unread,
Aug 20, 2003, 10:23:33 AM8/20/03
to
Hi Sreeram!

I can write code that may take long execution times. In this case OSwindows
may show window "Programm not responding" and this is bad. What can I do in
this case?

Thank's


"Sreeram" <sreer...@netscape.net> wrote in message

news:3F4351CA...@netscape.net...

Gary Chanson

unread,
Aug 20, 2003, 2:29:27 PM8/20/03
to

"Alex Klash" <Alexan...@hotmail.com> wrote in message
news:#yBv3XyZ...@tk2msftngp13.phx.gbl...

> Hi Sreeram!
>
> I can write code that may take long execution times. In this case
> OSwindows
> may show window "Programm not responding" and this is bad. What can I do
> in
> this case?

All you can do is refuse the shutdown, process your function, and the
restart the shutdown process. This, by the way, introduces a problem with
knowing exactly what type of shutdown was in progress.

--

-GJC
-Software Consultant (Embedded systems and Real Time Controls)
-gcha...@mvps.org

-Abolish public schools


Alex Klash

unread,
Aug 22, 2003, 1:18:43 AM8/22/03
to
subj!

"Gary Chanson" <gcha...@NOSPAM.TheWorld.com> wrote in message
news:#DE5yj0Z...@tk2msftngp13.phx.gbl...

Robot

unread,
Jul 27, 2008, 7:04:07 AM7/27/08
to

Let your main thread process windows messages, and create another thread
for your long-running-function.

Also TOP-POSTING IS BAD in the news group communities!

--
BTW, I use WebMailSelector because I have many email addresses.
I recommend it. It is available at http://www.mselector.com

0 new messages