Using Windows XP SP3 I noticed that my shutdown code no longer executes in %WM_CLOSE or %WM_DESTROY.

Also, is there a shutdown group like the startup group to execute a program on shutdown.
I signal some internet servers to quit sending my local machine messages on shutdown.

Had it in the wrong message.
Solution: Thanks Eric Pearson.
Code:
CASE %WM_QUERYENDSESSION
   PostQuitMessage 0
   CALL ShutDownCode
   FUNCTION = 1