Specifications
B-5
Appendix B
Implementation in Monitor Thread
8/6/2010 KR203 Software Integrator Guide P1028248-001 Rev. A
while(pInfo->m_hStatusEventKillThread)
{
if ((dwRet = WaitForMultipleObjects(2, myHandle, FALSE,
pInfo->dSleepTime))!=WAIT_FAILED)
{
if (dwRet==WAIT_OBJECT_0 || dwRet==WAIT_OBJECT_0+1)
{
if ((dwRet = GetPrinterData(pInfo->hPrinter,
L"Error", &dType, (LPBYTE)&dwResult, sizeof(dwResult),
&dNeeded))!=ERROR_SUCCESS)
{
swprintf_s( str, 50, L"### [Status Thread error
%d] read [%08X]\n", dwRet, dwResult);
} else
swprintf_s( str, 50, L"### [Status Thread] read
[%08X]\n", dwResult);
OutputDebugString(str);
swprintf_s( str, 50, L"### [Status Thread] read
[0x%08X]", dwResult);
SendMessage(hWnd, WM_SETTEXT, 0, (LPARAM)(str));
if (dwResult & 0x00000000)
SendMessage(hWnd, WM_SETTEXT, 0,
(LPARAM)(L"PRINTER_STATUS_OK"));
if (dwResult & PRINTER_STATUS_ERROR)
SendMessage(hWnd, WM_SETTEXT, 0,
(LPARAM)(L"PRINTER_STATUS_ERROR"));
if (dwResult & PRINTER_STATUS_PENDING_DELETION)
SendMessage(hWnd, WM_SETTEXT, 0,
(LPARAM)(L"PRINTER_STATUS_PENDING_DELETION"));
if (dwResult & PRINTER_STATUS_PAPER_JAM)
SendMessage(hWnd, WM_SETTEXT, 0,
(LPARAM)(L"PRINTER_STATUS_PAPER_JAM"));
if (dwResult & PRINTER_STATUS_PAPER_OUT)
SendMessage(hWnd, WM_SETTEXT, 0,
(LPARAM)(L"PRINTER_STATUS_PAPER_OUT"));
if (dwResult & PRINTER_STATUS_PAPER_PROBLEM)
SendMessage(hWnd, WM_SETTEXT, 0,
(LPARAM)(L"PRINTER_STATUS_PAPER_PROBLEM"));
if (dwResult & PRINTER_STATUS_OFFLINE)
SendMessage(hWnd, WM_SETTEXT, 0,
(LPARAM)(L"PRINTER_STATUS_OFFLINE"));
if (dwResult & PRINTER_STATUS_IO_ACTIVE)