You can follow the link below to download the Windows Event Queue VIs. You should be able to use these VIs to catch the wm_queryendsession message in labview. WM_QUERYENDSESSION is = to 0x0011 according to the readme file.
Thank You very much. I tried to catch the wm_queryendsession. But it didn't work. I think the runtime closes because of the wm. So the LabView-Application closes without read the wm.