-
Porting From SUN????
I am currently porting some server C-code from a SUN machine to NT. This code in not a GUI and I would like to keep it as C-code. On the SUN machine it users signals to determine when the machine is being booted, and the program will stop gracefully! Looks like I should use the NT message queue, but I am having no luck. I tried peekmessage() but it doesn't seem to trap the boot message "wm_queryendsession". Is this the right approach?
Thanks,
Dan Gray
[email protected]
-
Re: Porting From SUN????
Use SetConsoleCtrlHandler(...) and you will be able to intercept CTRL_C_EVENT, CTRL_BREAK_EVENT, CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT.
Success !
[email protected]