Tim,
Well, I suppose you are referring to WM_QUERYENDSESSION. The OnQueryEndSessions is probably just a handler for the message since
your app is likely written in some high level language like VB.Net or C#, right? For handling this message you theoretically only
need the basics (Win32 support, kernel, etc.). No special components required but...
Depending on what your image is based on this may or may not work. IIRC, WM_QUERYENDSESSION only reliable works within Explorer
Shell/Winlogon environment (well, maybe only Explorer is the requirement).
In Minlogon environment you want to switch to handle WM_POWERBROADCAST / PBT_APMSUSPEND message instead. Some more info here:
http://groups-beta.google.com/group...gst&q=QueryEndSession&rnum=1#e37bdaea59bfc6f3
Although even with Minlogon you should be careful and make sure you are working with the latest updates. I don't remember which QFE
fixed it but there was a problem seeing with old Minlogon where intercepting the WM_POWERBROADCAST message wasn't working in some
configurations (search NG archive, we covered the topic quite in details long time ago).
I personally prefer SetConsoleCtrlHandler. It works more stable with Minlogon. Read more here:
http://groups-beta.google.com/group...&q=WM_QUERYENDSESSION&rnum=1#760fbfd6bb8f4d1c