C 언어 시뮬레이션 키보드 코드는 다음과 같습니다:
intWINAPIWinMain(HINSTANCEhInstance, HINSTANCEhPrevInstance, LPSTRszCmdLine, intiCmdShow)
{
MSGmsg ;
p>
if(!MyRegisterClass(hInstance))
{
returnFALSE;
}
if(!InitInstance( hInstance, iCmdShow))
{
returnFALSE;
}
while(GetMessage(amp ; msg, NULL, 0, 0 ))
{
TranslateMessage(amp;msg);
DispatchMessage(amp;msg);
}
returnmsg.wParam;
}
//Function: ShowKey
//Function: 키 정보 표시 창
< p>voidShowKey(HWNDhwnd, intiType, char*szMessage, WPARAMwParam, LPARAMlParam){
staticchar*szFormat[2]={"-14s3dc6u4d5s5s6s6s" ,
"-14s3dc6u4d5s5s6s6s"};
charszBuffer[80];
HDChdc;
ScrollWindowEx(hwnd, 0, -yChar , rc, amp; rc, NULL, NULL, SW_INVALIDATE);
hdc=GetDC(hwnd);
SelectObject(hdc, GetStockObject(SYSTEM_FIXED_FONT));
TextOut(hdc ,
xChar,
rc.bottom-yChar,
szBuffer,
wsprintfszBuffer, p>
szFormat[ iType]