I have looked at iczelions example and i think i have it right but doesnt seem to work.
What I'm trying to do is to intercept the message WM_QUERYENDSESSION
when it is sent to any app currently running. I'm Using the WH_CALLWNDPROC hookid, with a null value for the thread ID.

invoke SetWindowsHookEx,WH_CALLWNDPROC,addr CallWndProc,hInstance,NULL

but the problem is it doesnt seem to redirect all messages thru my hook procedure. only messages from my window that installs the hook. I am using the same method as the example with a DLL.
Posted on 2003-05-26 05:24:38 by keyoke
Did you remember to make the datasections shared when you link?
Posted on 2003-05-26 11:50:25 by david
Yes it is shared....just not sure if this is the best way to check if a machine is attempting a reboot. and then to abort it.
Posted on 2003-05-27 02:02:09 by keyoke
lol, i remember some times.. that i dont wanna my PC reboot, i open and reopen applications (explorer) and other and after this.. no reboot.. but is manually and only in Extreme situations... lol
Posted on 2003-05-27 02:12:58 by rea
Ok shot ill have a look into that, is this on win2k. I'd rather have a cleaner method to do it tho.
thanks for your input
Posted on 2003-05-27 02:39:32 by keyoke