Still having problems but....
I've kept playing with this, and mostly gone round in circles.
Anyhow, I decided to make a small demo app to show the problem that I am experiencing.
Only thing is, it worked perfectly
Then I realised that I'm using Agraham's FormExDesktop library in my app because I use some of the extra functionality it offers.
Here is where the problem lies...
When using the FormExDesktop library my app no longer detects the WM_QUERYENDSESSION message although it does see the WM_ENDSESSION message.
If I use a normal Form with the Door library all works as it should.
Can anyone shed some light on this?
Attached is my demo app using Agrahams library, you need to also add the FormLib, ControlsExdesktop,dzEventsMagic and FormExDesktop libraries.
The Demo.exe is a complied normal Form using the door library and Demo1.exe is using an extended Form (for some reason I get an error when trying to show the Form using the notifyicon - I don't understand why!)
So just to confirm, the problem is that my app is NOT seeing the WM_QUERYENDSESSION although it does catch the WM_ENDSESION
Regards,
RandomCoder