LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ask to an CVI application for finish his operation.

Hi friends, I need some help.
I made a program that manages other programs or "process" using windows messaging. Im using a no break with a software that closes the sistem and all the applications (windows NT) when the power fails . I guess that program sends a message to all active applications for close by itselfs automatically. i need to know how to intercept this message in the "manager application" for make it tell the applications that it are holding to finish correctly.
Is ther a funtion on SDK for perform this or what?
Thanks for everything.
0 Kudos
Message 1 of 2
(2,939 Views)
What's happening is that a process (with proper priveledge) can issue a system shutdown request to the OS. The OS in turn issues WM_QUERYENDSESSION / WM_ENDSESSION to each window. The process that initiates the shutdown (using the SDK function ExitWindowsEx) can force each process to shutdown whether it wants to or not by using the EWX_FORCE flag in the ExitWindowsEx call, though typically you do not do this because data can be lost.

Some UPS applications (for example APC's) let you specify the exact behavior you want - i.e., wait for an app to shut itself down after being sent WM_ENDSESSION, or force apps to shutdown either immediately or after some delay. I would check your UPS software and see if you can tailor the process shutdown semantics to your liking.

I
n a CVI application, you can register a main window callback with RegisterWinMsgCallback. It's not clear (to me anyway) if this function can be made to intercept WM_QUERYENDSESSION or WM_ENDSESSION.

There is a discussion on system shutdown in the Win32 SDK provided with CVI. See the topic "System Shutdown".
0 Kudos
Message 2 of 2
(2,939 Views)