Click here to Skip to main content
15,888,330 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help native C++ and .net Pin
ashish8patil6-May-09 0:17
ashish8patil6-May-09 0:17 
GeneralRe: Help native C++ and .net Pin
ThatsAlok6-May-09 1:16
ThatsAlok6-May-09 1:16 
GeneralRe: Help native C++ and .net Pin
ashish8patil6-May-09 3:14
ashish8patil6-May-09 3:14 
GeneralRe: Help native C++ and .net Pin
ashish8patil6-May-09 19:03
ashish8patil6-May-09 19:03 
QuestionHow to abort forcefully shutdown, reastart or logoff Pin
Abhijit A5-May-09 20:14
Abhijit A5-May-09 20:14 
AnswerRe: How to abort forcefully shutdown, reastart or logoff Pin
«_Superman_»5-May-09 20:24
professional«_Superman_»5-May-09 20:24 
GeneralRe: How to abort forcefully shutdown, reastart or logoff Pin
Abhijit A5-May-09 21:01
Abhijit A5-May-09 21:01 
GeneralRe: How to abort forcefully shutdown, reastart or logoff [modified] Pin
enhzflep5-May-09 21:19
enhzflep5-May-09 21:19 
Oops!

I appear to have misread your post. If you want to _prevent_ somebody from shutting down windows, you'll need to hook ShutdownWindowsEx & SetSuspendState (or to be more precise, the kernel ZwShutDownWindows or NTShutDownWindows or something like that, I forget.

This will allow you to process any requests to shut down the box before the O/S does. Then all you have to do is return an error code every time, whilst never actually shutting down/standing by or hibernating the box.

You want to do basically what SetWindowsHookEx will do, except you want to do it with calls to the functions that power windows down, instead of to the messages that are between windows . I think you'll find what you're after if you search for function hooks.

This is the sort of thing you want: http://www.bigwebmaster.com/2068.html[^], just make sure you find one that's being given away - there should be no need to pay.


[EDIT]:
See here for the answer:

Cached google copy of 'prevent EWX_FORCE' forum post[^]

modified on Wednesday, May 6, 2009 3:34 AM

AnswerRe: How to abort forcefully shutdown, reastart or logoff Pin
enhzflep5-May-09 21:04
enhzflep5-May-09 21:04 
GeneralRe: How to abort forcefully shutdown, reastart or logoff Pin
Abhijit A5-May-09 21:17
Abhijit A5-May-09 21:17 
AnswerRe: How to abort forcefully shutdown, reastart or logoff Pin
Stuart Dootson6-May-09 2:05
professionalStuart Dootson6-May-09 2:05 
GeneralRe: How to abort forcefully shutdown, reastart or logoff Pin
David Crow6-May-09 3:11
David Crow6-May-09 3:11 
GeneralRe: How to abort forcefully shutdown, reastart or logoff Pin
Stuart Dootson6-May-09 3:21
professionalStuart Dootson6-May-09 3:21 
QuestionMFC application has encountered a problem and need to close Pin
ganesh.dp5-May-09 20:07
ganesh.dp5-May-09 20:07 
AnswerRe: MFC application has encountered a problem and need to close Pin
Cedric Moonen5-May-09 20:29
Cedric Moonen5-May-09 20:29 
AnswerRe: MFC application has encountered a problem and need to close Pin
_AnsHUMAN_ 5-May-09 21:38
_AnsHUMAN_ 5-May-09 21:38 
AnswerRe: MFC application has encountered a problem and need to close Pin
ThatsAlok5-May-09 23:20
ThatsAlok5-May-09 23:20 
AnswerRe: MFC application has encountered a problem and need to close Pin
Hamid_RT5-May-09 23:28
Hamid_RT5-May-09 23:28 
GeneralRe: MFC application has encountered a problem and need to close Pin
ganesh.dp5-May-09 23:36
ganesh.dp5-May-09 23:36 
AnswerRe: MFC application has encountered a problem and need to close Pin
David Crow6-May-09 3:14
David Crow6-May-09 3:14 
QuestionPartial Specialization of Templated Class Member Function Pin
Jmuulian5-May-09 19:26
Jmuulian5-May-09 19:26 
AnswerRe: Partial Specialization of Templated Class Member Function Pin
«_Superman_»5-May-09 20:04
professional«_Superman_»5-May-09 20:04 
AnswerRe: Partial Specialization of Templated Class Member Function Pin
Stuart Dootson6-May-09 2:14
professionalStuart Dootson6-May-09 2:14 
QuestionOpening a Visual Studio .NET application in Visual Studio C++ Pin
SivaGK5-May-09 19:26
SivaGK5-May-09 19:26 
AnswerRe: Opening a Visual Studio .NET application in Visual Studio C++ Pin
«_Superman_»5-May-09 19:29
professional«_Superman_»5-May-09 19:29 

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.