¿Cómo simula el lenguaje C la entrada del teclado?
El código del teclado de simulación de lenguaje C es el siguiente:
intWINAPIWinMain(HINSTANCEhInstance,HINSTANCEhPrevInstance,LPSTRszCmdLine,intiCmdShow)
{
MSGmsg ;
p>if(!MyRegisterClass(hInstance))
{
returnFALSE;
}
if(!InitInstance( hInstance,iCmdShow))
{
returnFALSE;
}
while(GetMessage(&msg,NULL, 0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
returnmsg.wParam ;
}
//Función: ShowKey
//Función: Mostrar información clave en la ventana
voidShowKey(HWNDhwnd, intiType,char*szMessage,WPARAMwParam,LPARAMlParam)
{
staticchar*szFormat[2]={"%-14s%3d%c%6u%4d% 5s%5s% 6s%6s",
"%-14s%3d%c%6u%4d%5s%5s%6s%6s"};
charszBuffer[80] ;
HDChdc;
ScrollWindowEx(hwnd,0,-yChar,&rc,&rc,NULL,NULL,SW_INVALIDATE);
hdc=GetDC(hwnd) ;
SelectObject(hdc,GetStockObject(SYSTEM_FIXED_FONT));
TextOut(hdc,
xChar,
rc.bottom-yChar ,
szBuffer,
wsprintfszBuffer,
szFormat[iType]