The SetAbortProc function sets the application-defined abort function that allows a print job to be canceled during spooling. This function replaces the SETABORTPROC printer escape.
int SetAbortProc(
| HDC hdc, | // handle of device context | 
| ABORTPROC lpAbortProc | // address of abort function | 
| ); | 
If the function succeeds, the return value is greater than zero.
If the function fails, the return value is SP_ERROR. To get extended error information, call GetLastError.