The PrinterMessageBox function displays a message box that lets an application that is printing notify the user of a printing job error. If the owner of the job is logged on remotely, the function sends a net popup to the owner. If the user selects Cancel in the message box, the function cancels the print job; otherwise, the function clears the job error status, and the system tries to print the job again.
HPRINTER PrinterMessageBox (
|
HANDLE hPrinter, |
// handle of printer |
|
DWORD Error, |
// error identifier |
|
HWND hWnd, |
// handle of owner window |
|
LPTSTR pText, |
// pointer to message box text |
|
LPTSTR pCaption, |
// pointer to message box title |
|
DWORD dwType |
// style of message box |
|
); |
|
Value |
Meaning |
|
ERROR_OUT_OF_PAPER |
The printer is out of paper. |
|
ERROR_NOT_READY |
The printer is not ready. |
MB_ICONSTOP | MB_RETRYCANCEL | MB_SETFOREGROUND
If PrinterMessageBox sends a net popup, the return value is IDOK. Otherwise, the function returns the value returned by the message box the function displays. Two typical return values are the following:
|
Value |
Meaning |
|
IDCANCEL |
Cancel button was selected. |
|
IDRETRY |
Retry button was selected. |
For a more complete list of message box return values, see MessageBox.