int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // pointer to command line
int nCmdShow // show state of window
)
case WM_SIZE:
cxClient=LOWORD(lParam);
cyClient=HIWORD(lParam);
rect.left=0;
rect.top=cyChar;
rect.right=cxClient;
rect.bottom=cyChar*(cyClient/cyChar);
return 0;
case WM_KEYDOWN:
case WM_KEYUP:
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
case WM_DEADCHAR:
case WM_SYSCHAR:
case WM_SYSDEADCHAR:
case WM_CHAR:
for(i=cLinesMax-1;i>0;i--)
pmsg[i]=pmsg[i-1];
pmsg[0].hwnd=hwnd;
pmsg[0].message=message;
pmsg[0].wParam=wParam;
pmsg[0].lParam=lParam;
cLines=min(cLines+1,cLinesMax);
ScrollWindow(hwnd,0,-cyChar,&rect,&rect);
UpdateWindow(hwnd);
return 0;
case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
hFont=CreateFont(0,0,0,0,0,
0,0,0,dwCharSet,0,0,0,FIXED_PITCH,0);
SelectObject(hdc,hFont);
TextOut(hdc,0,0,szTop,lstrlen(szTop));
SetBkMode(hdc,TRANSPARENT);
TextOut(hdc,0,0,szUnd,lstrlen(szUnd));
for(i=0;i<min(cLines,cyClient/cyChar-1);i++)
{
iType=pmsg[i].message==WM_CHAR||
pmsg[i].message==WM_SYSCHAR||
pmsg[i].message==WM_DEADCHAR||
pmsg[i].message==WM_SYSDEADCHAR;
GetKeyNameText(pmsg[i].lParam,szKeyName,20);