Click here to Skip to main content
15,886,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: MFC silent executable running from system account not recieveing WM_QUERYENDSESSION message ?? Pin
David Crow21-Oct-09 3:34
David Crow21-Oct-09 3:34 
AnswerRe: MFC silent executable running from system account not recieveing WM_QUERYENDSESSION message ?? Pin
Kushagra Tiwari21-Oct-09 3:39
Kushagra Tiwari21-Oct-09 3:39 
QuestionRe: MFC silent executable running from system account not recieveing WM_QUERYENDSESSION message ?? Pin
David Crow21-Oct-09 3:52
David Crow21-Oct-09 3:52 
AnswerRe: MFC silent executable running from system account not recieveing WM_QUERYENDSESSION message ?? Pin
Kushagra Tiwari21-Oct-09 3:59
Kushagra Tiwari21-Oct-09 3:59 
QuestionRe: MFC silent executable running from system account not recieveing WM_QUERYENDSESSION message ?? Pin
Kushagra Tiwari21-Oct-09 4:23
Kushagra Tiwari21-Oct-09 4:23 
AnswerRe: MFC silent executable running from system account not recieveing WM_QUERYENDSESSION message ?? Pin
David Crow21-Oct-09 4:36
David Crow21-Oct-09 4:36 
AnswerRe: MFC silent executable running from system account not recieveing WM_QUERYENDSESSION message ?? Pin
Covean21-Oct-09 5:05
Covean21-Oct-09 5:05 
AnswerRe: MFC silent executable running from system account not recieveing WM_QUERYENDSESSION message ?? Pin
Roger Stoltz21-Oct-09 5:43
Roger Stoltz21-Oct-09 5:43 
Kushagra Tiwari wrote:
I have made an MFC application with invisible window and invisible in Applications tab of taskmanager
....
I have made one instance of this executable to run in 'SYSTEM' account


Does this mean that you have created a service?



Kushagra Tiwari wrote:
how to abort scheduled shutdown in Windows from an application running in system account


Are you certain that you really want to do this even if it's possible?
What do you mean by 'scheduled'?

Personally I find it suspicious that you have created an application that runs "invisible" from user perspective that aims to block the system from being brought down. I would consider it to be a very anti-social application that I wouldn't want running on any of my machines.
However, if an application calls ::ExitWindowsEx() with the EWK_FORCE parameter, WM_QUERYENDSESSION will not be sent - all processes will be terminated and possibly with data lost.

How do you distinguish from a 'scheduled' shutdown and one triggered by a user in your message handler or callback? I guess the user won't be able to bring the system down either....
What if your application runs on a machine with UPS; the power is lost and the UPS service wants to bring the system down safely? Will you block it if possible?

I guess my question really is "what are to trying to accomplish and why"? There may be a better solution.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


QuestionJavaScript call from C++ Pin
cdpc20-Oct-09 20:37
cdpc20-Oct-09 20:37 
AnswerRe: JavaScript call from C++ Pin
CPallini20-Oct-09 22:01
mveCPallini20-Oct-09 22:01 
AnswerRe: JavaScript call from C++ Pin
Adam Roderick J20-Oct-09 22:38
Adam Roderick J20-Oct-09 22:38 
Questionhow to stop a .exe? Pin
002comp20-Oct-09 20:24
002comp20-Oct-09 20:24 
QuestionRe: how to stop a .exe? Pin
CPallini20-Oct-09 20:27
mveCPallini20-Oct-09 20:27 
AnswerRe: how to stop a .exe? Pin
002comp20-Oct-09 20:39
002comp20-Oct-09 20:39 
QuestionRe: how to stop a .exe? Pin
CPallini20-Oct-09 20:46
mveCPallini20-Oct-09 20:46 
AnswerRe: how to stop a .exe? Pin
002comp20-Oct-09 21:18
002comp20-Oct-09 21:18 
GeneralRe: how to stop a .exe? Pin
Rajesh R Subramanian20-Oct-09 21:21
professionalRajesh R Subramanian20-Oct-09 21:21 
GeneralRe: how to stop a .exe? Pin
ThatsAlok20-Oct-09 21:52
ThatsAlok20-Oct-09 21:52 
GeneralRe: how to stop a .exe? Pin
CPallini21-Oct-09 0:26
mveCPallini21-Oct-09 0:26 
GeneralRe: how to stop a .exe? Pin
002comp21-Oct-09 0:28
002comp21-Oct-09 0:28 
GeneralRe: how to stop a .exe? Pin
Rajesh R Subramanian21-Oct-09 6:48
professionalRajesh R Subramanian21-Oct-09 6:48 
QuestionRe: how to stop a .exe? Pin
Randor 20-Oct-09 21:49
professional Randor 20-Oct-09 21:49 
AnswerRe: how to stop a .exe? Pin
ThatsAlok20-Oct-09 21:51
ThatsAlok20-Oct-09 21:51 
AnswerRe: how to stop a .exe? ADDENDUM Pin
ThatsAlok20-Oct-09 21:52
ThatsAlok20-Oct-09 21:52 
GeneralRe: how to stop a .exe? ADDENDUM Pin
Richard MacCutchan21-Oct-09 2:21
mveRichard MacCutchan21-Oct-09 2:21 

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.