㩷
7. Append the source code below in the main function of
DeviceApp.cpp
.
DWORD result;
TCHAR msg[16];
result = SysSetLED(LED_RED, 5, 8, 8);
if(result == TRUE)
{
result = SysGetLED();
switch(result & 0x0000000F) {
case LED_OFF:
wcscpy_s( msg, _countof(msg), TEXT("LED_OFF") );
break;
case LED_RED:
wcscpy_s( msg, _countof(msg), TEXT("LED_RED") );
break;
case LED_GREEN:
wcscpy_s( msg, _countof(msg), TEXT("LED_GREEN") );
break;
case LED_ORANGE:
wcscpy_s( msg, _countof(msg), TEXT("LED_ORANGE") );
break;
case LED_BLUE:
wcscpy_s( msg, _countof(msg), TEXT("LED_BLUE") );
break;
case LED_CYAN:
wcscpy_s( msg, _countof(msg), TEXT("LED_CYAN") );
break;
case LED_MAGENTA:
wcscpy_s( msg, _countof(msg), TEXT("LED_MAGENTA") );
break;
default:
wcscpy_s( msg, _countof(msg), TEXT("LED_UNKNOWN") );
break;
}
MessageBox(NULL, msg, TEXT("LED"), MB_OK);
}
62
㩷