Override WndProc is stopping shutdown



Hello,

I am overriding the WndProc in my main form of a Windows application
and the design is for it to ask for some info, kill the application,
and continue on to either shutdown or restart. This is working fine
for the go into hibernation or standby mode, however with shutdown, it
stops after receiving the advice and killing itself. Here is my code:

if (m.Msg == WM_SHUTDOWN)
{
m.Msg = WM_SHUTDOWN;
m.Result = (IntPtr) 1;

KillAgentWithStatusChange(); //this asks for information and than
kills the application

base.WndProc(ref m);

return;

}

The reason I am killing the application is because Windows (for some
reason) won't shut down with the application running. Even after
removing this code, it still does not do the trick. What in the
application could cause Windows not to shutdown when prompted?

Many thanks in advance!

Dan Kisting

.



Relevant Pages

  • Re: Registry Fix For Variant of Scob
    ... No reason to set the kill bit? ... "You should be able to use this to compromise Windows XP SP2 through ... Internet Explorer despite the My Computer zone hardening since the ... Setting the kill bit on the "Shell.Application" ActiveX object, ...
    (NT-Bugtraq)
  • RE: Registry Fix For Variant of Scob
    ... No reason to set the kill bit? ... "You should be able to use this to compromise Windows XP SP2 through ... Internet Explorer despite the My Computer zone hardening since the ... Setting the kill bit on the "Shell.Application" ActiveX object, ...
    (Bugtraq)
  • Re: Shutdown Problems
    ... Before trying to shutdown, hit ctrl+shift+escape and kill some of the ... repeat the process and kill a few more. ... I have serious problems shutting down my Windows XP Home pc with Service ... AOL have provided me with a fix and installed the ...
    (microsoft.public.windowsxp.basics)
  • 45 sec. to shutdown? Is that normal?
    ... When a user shuts down Windows XP, ... If you modify this ... then windows will kill the service earlier. ... >It sits there for 45 seconds after you press a shutdown ...
    (microsoft.public.windowsxp.general)
  • 45 sec. to shutdown? Is that normal?
    ... When a user shuts down Windows XP, ... If you modify this ... then windows will kill the service earlier. ... >It sits there for 45 seconds after you press a shutdown ...
    (microsoft.public.windowsxp.general)