Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
windows shutdown notification
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rahul  
View profile  
 More options May 16 2012, 12:27 am
Newsgroups: microsoft.public.vc.mfc
From: rahul <hyrahu...@gmail.com>
Date: Tue, 15 May 2012 21:27:57 -0700 (PDT)
Local: Wed, May 16 2012 12:27 am
Subject: windows shutdown notification
Is there any way to make MFC application being notified at windows
shutdown event.
I have tried WM_QUERYWNDSESSION message but it didn't help.
Can anybody send me code to do that??

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Lowndes  
View profile  
 More options May 16 2012, 3:00 am
Newsgroups: microsoft.public.vc.mfc
From: David Lowndes <Dav...@example.invalid>
Date: Wed, 16 May 2012 08:00:52 +0100
Local: Wed, May 16 2012 3:00 am
Subject: Re: windows shutdown notification

>Is there any way to make MFC application being notified at windows
>shutdown event.
>I have tried WM_QUERYWNDSESSION message but it didn't help.

WM_QUERYENDSESSION should be the message to handle.

When you say "it didn't help", what exactly do you mean?

Dave


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rahul  
View profile  
 More options May 16 2012, 4:03 am
Newsgroups: microsoft.public.vc.mfc
From: rahul <hyrahu...@gmail.com>
Date: Wed, 16 May 2012 01:03:16 -0700 (PDT)
Local: Wed, May 16 2012 4:03 am
Subject: Re: windows shutdown notification
On May 16, 12:00 pm, David Lowndes <Dav...@example.invalid> wrote:

> >Is there any way to make MFC application being notified at windows
> >shutdown event.
> >I have tried WM_QUERYWNDSESSION message but it didn't help.

> WM_QUERYENDSESSION should be the message to handle.

> When you say "it didn't help", what exactly do you mean?

> Dave

I developed dialog based application in vc++ 6.0.
There is no OnQueryEndSession() function in classwizard i manually add
that in header file, source file and also in messagemap
(ON_WM_QUERYENDSESSION macro) and run application.
But when i put breakpoint and run application in debug mode and
shutdown PC breakpoint doesn't hit and PC shutdown.
Why??

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rahul  
View profile  
 More options May 16 2012, 4:19 am
Newsgroups: microsoft.public.vc.mfc
From: rahul <hyrahu...@gmail.com>
Date: Wed, 16 May 2012 01:19:07 -0700 (PDT)
Local: Wed, May 16 2012 4:19 am
Subject: Re: windows shutdown notification
 developed a dialog based application in VC++ 6.0. I manually added
afx_msg BOOL OnQueryEndSession() in header file
ON_WM_QUERYENDSESSION() in message macro
and
BOOL CSomeDlg::OnQueryEndSession()
{
        return FALSE;

}

in cpp file.

When I run the application in debug mode and put the breakpoint in
above
function and then shutdown pc
breakpoint should be hit.
but breakpoint didn't hit and windows shuts down normally.
---------------------------

I want my application displays some message box before windows shut
down..
How this could be done?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Wolstenholme  
View profile  
 More options May 16 2012, 5:31 am
Newsgroups: microsoft.public.vc.mfc
From: Stephen Wolstenholme <st...@npsl1.com>
Date: Wed, 16 May 2012 10:31:06 +0100
Local: Wed, May 16 2012 5:31 am
Subject: Re: windows shutdown notification
On Tue, 15 May 2012 21:27:57 -0700 (PDT), rahul <hyrahu...@gmail.com>
wrote:

>Is there any way to make MFC application being notified at windows
>shutdown event.
>I have tried WM_QUERYWNDSESSION message but it didn't help.
>Can anybody send me code to do that??

WM_CLOSE ?

Steve

--
Neural Network Software.                     http://www.npsl1.com
EasyNN-plus. Neural Networks plus.           http://www.easynn.com
SwingNN.     Forecast with Neural Networks.  http://www.swingnn.com
JustNN.      Just Neural Networks.           http://www.justnn.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Farnsworth  
View profile  
 More options May 16 2012, 3:28 pm
Newsgroups: microsoft.public.vc.mfc
From: "Farnsworth" <nos...@nospam.com>
Date: Wed, 16 May 2012 15:28:24 -0400
Local: Wed, May 16 2012 3:28 pm
Subject: Re: windows shutdown notification
"rahul" <hyrahu...@gmail.com> wrote in message

news:ce7c4c2b-1572-4ff2-9059-c02848ff7940@w10g2000vbc.googlegroups.com...

I think that Windows doesn't send this message to every window, only top
level windows. Try using Spy++ to see if your window is a child of another
window, or use GetAncestor(GA_PARENT), which should return 0.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Lowndes  
View profile  
 More options May 16 2012, 6:59 pm
Newsgroups: microsoft.public.vc.mfc
From: David Lowndes <Dav...@example.invalid>
Date: Wed, 16 May 2012 23:59:45 +0100
Local: Wed, May 16 2012 6:59 pm
Subject: Re: windows shutdown notification

I don't know what you've got wrong - everything you've mentioned looks
fine. I've just added a handler for WM_QUERYENDSESSION to a default
MFC dialog application using VS2008 and the breakpoint was hit. I can
see no real differences in what the tool generated and what you
mentioned above.

Dave


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rahul  
View profile  
 More options May 17 2012, 12:06 am
Newsgroups: microsoft.public.vc.mfc
From: rahul <hyrahu...@gmail.com>
Date: Wed, 16 May 2012 21:06:33 -0700 (PDT)
Local: Thurs, May 17 2012 12:06 am
Subject: Re: windows shutdown notification
On May 17, 12:28 am, "Farnsworth" <nos...@nospam.com> wrote:

Main dialog( in which i kept handler) in dialod based application is
top level window.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rahul  
View profile  
 More options May 17 2012, 12:10 am
Newsgroups: microsoft.public.vc.mfc
From: rahul <hyrahu...@gmail.com>
Date: Wed, 16 May 2012 21:10:06 -0700 (PDT)
Local: Thurs, May 17 2012 12:10 am
Subject: Re: windows shutdown notification
On May 17, 3:59 am, David Lowndes <Dav...@example.invalid> wrote:

I just want to know, if everything goes right, and if we return FALSE
in OnQueryEndSession() what will heppan? Windows will not shut down pc?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Lowndes  
View profile  
 More options May 17 2012, 3:25 am
Newsgroups: microsoft.public.vc.mfc
From: David Lowndes <Dav...@example.invalid>
Date: Thu, 17 May 2012 08:25:22 +0100
Local: Thurs, May 17 2012 3:25 am
Subject: Re: windows shutdown notification

>I just want to know, if everything goes right, and if we return FALSE
>in OnQueryEndSession() what will heppan? Windows will not shut down pc?

That's what the documentation says.

Dave


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Farnsworth  
View profile  
 More options May 17 2012, 6:23 am
Newsgroups: microsoft.public.vc.mfc
From: "Farnsworth" <nos...@nospam.com>
Date: Thu, 17 May 2012 06:23:22 -0400
Local: Thurs, May 17 2012 6:23 am
Subject: Re: windows shutdown notification
"David Lowndes" <Dav...@example.invalid> wrote in message

news:3t99r7dt097bd3so346nqe9jod9cfc5i0e@4ax.com...

> >I just want to know, if everything goes right, and if we return FALSE
>>in OnQueryEndSession() what will heppan? Windows will not shut down pc?

> That's what the documentation says.

Actually, it could in some cases like in terminal servers. It's very common
for administrators to log off disconnected sessions, or set it to auto log
off if disconnected after a period of time. When that happens, your
application that might be displaying "Do you want to save?" prompt will be
allowed only 5 seconds to terminate, after that, the process is
automatically killed. This is because the session is disconnected and
invisible, so no one is responding to the Save prompt. This is documented
somewhere in MSDN.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Sherren  
View profile  
 More options May 24 2012, 10:12 am
Newsgroups: microsoft.public.vc.mfc
From: inva...@invalid.invalid (Tom Sherren)
Date: Thu, 24 May 2012 14:12:20 GMT
Local: Thurs, May 24 2012 10:12 am
Subject: Re: windows shutdown notification
In article <ce7c4c2b-1572-4ff2-9059-c02848ff7...@w10g2000vbc.googlegroups.com>, rahul <hyrahu...@gmail.com> wrote:

Perhaps the problem is due to the app being dialog based.

I have a vc++ 6.0 application that has a a main frame derived from CFrameWnd.  
WM_QUERYENDSESSION works for this program as follows.

IMPLEMENT_DYNCREATE(CMyMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMyMainFrame, CFrameWnd)
    //{{AFX_MSG_MAP(CCMyMainFrame)
    ON_WM_CREATE()
    ON_WM_INITMENUPOPUP()
    ON_WM_SIZE()
    ON_WM_MENUSELECT()
    ON_WM_MOVE()
    ON_WM_QUERYENDSESSION()
    ON_WM_CLOSE()
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

// Ask the user if they want to save data before
// closing the application.

BOOL CMyMainFrame::OnQueryEndSession()
{
    if (!CFrameWnd::OnQueryEndSession())
        return FALSE;

    if (!g_pDoc->AskSaveDataQuestion())            // part of my app      
    {
        // User said "Cancel" so keep the windows session open
        return FALSE;
    }

    return TRUE;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Moore  
View profile  
 More options May 26 2012, 5:45 pm
Newsgroups: microsoft.public.vc.mfc
From: Bob Moore <b...@mvps.org>
Date: Sat, 26 May 2012 22:45:50 +0100
Local: Sat, May 26 2012 5:45 pm
Subject: Re: windows shutdown notification
On Wed, 16 May 2012 01:03:16 -0700 (PDT), rahul <hyrahu...@gmail.com>
wrote:

>I developed dialog based application in vc++ 6.0.
>There is no OnQueryEndSession() function in classwizard i manually add
>that in header file, source file and also in messagemap

It's being filtered out. Go to the Class Info tab in ClassWizard and
change the message filter to Window.

I can't see any error in the method you've posted. Did you add

        afx_msg BOOL OnQueryEndSession();

between the AFX_MSG macros ?

--
Bob Moore
http://bobmoore.mvps.org/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »