LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to run a shutdown function in a CVI program before Windows XP shuts down and kills my CVI process.

hi all,

I wrote the following procedure and registered it via "SetWindowLong()" to my mainPanel like described above:

LRESULT APIENTRY EditSubclassProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
if(uMsg==WM_QUERYENDSESSION || uMsg==WM_ENDSESSION)
{
//Do cleanup...and:
QuitUserInterface (0);
}

//Standard-Methode
return CallWindowProc((WNDPROC) pOldEventHandler, wnd, uMsg,wParam, lParam);
}

two things I do not understand:

1. it runs ok under XP, but the method is not called by the OS under W2K

2. the WM_ENDSESSION is pending. so the OS goes down after closing my application manually. is it possible to change this ?

Any comments or ideas ?

Thanks and best regards

Simon
0 Kudos
Message 11 of 12
(1,525 Views)
Hi Simon,

I would suggest researching MSDN for the answers to both of these questions since they more about the Windows SDK. As a starting point, this is the function help for SetWindowLong().

Regards,
0 Kudos
Message 12 of 12
(1,496 Views)