Click to See Complete Forum and Search --> : Porting From SUN????


dan gray
April 16th, 1999, 07:39 AM
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
dgray@syscom-inc.com

Daniel
April 16th, 1999, 11:22 AM
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 !
dpravat@usa.net