User manual - イメージャライブラリマニュアルver.1.06(2012年3月29日)

Table Of Contents
227
IMGSetDeliberation(IMG_DECODE_QUICK);
break;
case WM_DESTROY:
SetEvent( g_hDecodeEvent[ 1]);
IMGDisconnect();
IMGDeinit();
WaitForSingleObject( hDecodeThread, INFINITE);
CloseHandle( hDecodeThread);
CloseHandle( g_hDecodeEvent[ 1]);
CloseHandle( g_hDecodeEvent[ 0]);
PostQuitMessage( 0);
break;
default:
return DefWindowProc( hWnd, message, wParam, lParam);
}
return 0;
}
DWORD WINAPI DecodeThread( LPVOID pParameter)
{
BOOL bDecodeLoop = TRUE;
DWORD dwObjectNum, dwLength;
int nResult;
TCHAR chCodeID, chAimID, chModifier, szDecodeMessage[ 512];
while( bDecodeLoop)
{
dwObjectNum = WaitForMultipleObjects( 2, g_hDecodeEvent, FALSE, INFINITE);
switch( dwObjectNum)
{
case WAIT_OBJECT_0:
nResult = IMGWaitForDecode( 20000, szDecodeMessage, &chCodeID, &chAimID,
&chModifier, &dwLength, NULL);
if ( nResult == IMG_SUCCESS)
{
SetWindowText( g_hEditMessage, szDecodeMessage);
}
break;
case ( WAIT_OBJECT_0+1):
bDecodeLoop = FALSE;
break;
}
}
ExitThread( 0);
return 0;
}