Click here to Skip to main content
15,917,060 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Pointer to DWORD Pin
Taka Muraoka8-Apr-03 14:59
Taka Muraoka8-Apr-03 14:59 
GeneralRe: Pointer to DWORD Pin
DuFF8-Apr-03 15:21
DuFF8-Apr-03 15:21 
GeneralRe: Pointer to DWORD Pin
Taka Muraoka8-Apr-03 15:27
Taka Muraoka8-Apr-03 15:27 
GeneralAutomation compliant COM Vs ActiveX Pin
devvvy8-Apr-03 12:59
devvvy8-Apr-03 12:59 
GeneralRe: Automation compliant COM Vs ActiveX Pin
J. Dunlap8-Apr-03 14:02
J. Dunlap8-Apr-03 14:02 
GeneralRe: Automation compliant COM Vs ActiveX Pin
Anonymous8-Apr-03 17:57
Anonymous8-Apr-03 17:57 
GeneralRe: Automation compliant COM Vs ActiveX Pin
J. Dunlap8-Apr-03 18:01
J. Dunlap8-Apr-03 18:01 
GeneralApplication aborts Windows shutdown Pin
RaiderCE8-Apr-03 12:35
RaiderCE8-Apr-03 12:35 
This problem has been driving me nuts for several days and I'm hoping a fresh mind out there can shed some light on this problem for me.

I've written an MFC application that can be installed as an NT service. Naturally, an NT service isn't terminated when the user logs out, however I do want to do a few things within the app when the user logs out or shuts down the computer. I'm able to determine when the user is logging out and perform the appropriate functionality by acting on the WM_QUERYENDSESSION and WM_ENDSESSION Windows messages.

Here's the problem. When the user logs out, everything is fine. They log back in and my service is still running as it should be. When they log back out or attempt to shutdown, it would appear that my application aborts the log off / shutdown. However, I'm always returning true to the WM_QUERYENDSESSION message. If I remove my handling of the WM_QUERYENDSESSION message, the same still happens.

It gets even weirder when I discovered that my application doesn't even receive the WM_QUERYENDSESSION message the second time I try logging out, but it DOES receive the WM_ENDSESSION message (with wParam = 0).

If I close my application, Windows is fine shutting down. If I restart my application, it works fine once before repeating the above.

Can someone save the remainder of my hair before I finish pulling it out?!
GeneralCDC::TransparentBlt Pin
john john mackey8-Apr-03 11:55
john john mackey8-Apr-03 11:55 
GeneralRe: CDC::TransparentBlt Pin
Brian Shifrin8-Apr-03 13:29
Brian Shifrin8-Apr-03 13:29 
QuestionHow do I output the IP Address after getting computer name?? Pin
IrishSonic8-Apr-03 11:18
IrishSonic8-Apr-03 11:18 
AnswerRe: How do I output the IP Address after getting computer name?? Pin
Bartosz Bien8-Apr-03 11:28
Bartosz Bien8-Apr-03 11:28 
GeneralRe: How do I output the IP Address after getting computer name?? Pin
IrishSonic8-Apr-03 12:26
IrishSonic8-Apr-03 12:26 
GeneralRe: How do I output the IP Address after getting computer name?? Pin
Bartosz Bien8-Apr-03 13:09
Bartosz Bien8-Apr-03 13:09 
AnswerRe: How do I output the IP Address after getting computer name?? Pin
csc8-Apr-03 21:10
csc8-Apr-03 21:10 
AnswerRe: How do I output the IP Address after getting computer name?? Pin
Dudi Avramov8-Apr-03 22:22
Dudi Avramov8-Apr-03 22:22 
GeneralProgramming Graphic LCD Panels Pin
#realJSOP8-Apr-03 9:37
professional#realJSOP8-Apr-03 9:37 
QuestionOverloaded Methods & COM: ??? Pin
J. Dunlap8-Apr-03 9:17
J. Dunlap8-Apr-03 9:17 
AnswerRe: Overloaded Methods & COM: ??? Pin
Le centriste8-Apr-03 11:07
Le centriste8-Apr-03 11:07 
GeneralRe: Overloaded Methods & COM: ??? Pin
J. Dunlap8-Apr-03 11:11
J. Dunlap8-Apr-03 11:11 
GeneralI found the answer! :-) :-) Pin
J. Dunlap8-Apr-03 13:38
J. Dunlap8-Apr-03 13:38 
GeneralRe: I found the answer! :-) :-) Pin
Le centriste8-Apr-03 18:05
Le centriste8-Apr-03 18:05 
GeneralPreventing tree node from collapsing Pin
Ravi Bhavnani8-Apr-03 8:39
professionalRavi Bhavnani8-Apr-03 8:39 
GeneralRe: Preventing tree node from collapsing Pin
Nick Parker8-Apr-03 11:27
protectorNick Parker8-Apr-03 11:27 
GeneralRe: Preventing tree node from collapsing Pin
Ravi Bhavnani8-Apr-03 11:34
professionalRavi Bhavnani8-Apr-03 11:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.