Lập trình sự kiện - các thư viện lập trình của windows - trần minh thái - 3
Bài 3:Các thiết bị nhập liệu
crPrevBk = SetBkColor(hdc, RGB(0,0,0)); TextOut(hdc, nCaretPosX, nCaretPosY * dwCharY, &ch, 1); SetTextColor(hdc, crPrevText); SetBkColor(hdc, crPrevBk); } // Get the width of the character and // calculate the new horizontal position of the caret. GetCharWidth32(hdc, ch, ch, &nCharWidth); ReleaseDC(hwndMain, hdc); nCaretPosX = nCaretPosX + nCharWidth; } nCurChar++; ShowCaret(hwndMain); break; } break; case VK_UP: // UP ARROW case VK_DOWN: // DOWN ARROW MessageBeep((UINT) -1); return 0; case VK_HOME: // HOME // Set the caret's position to the upper left // corner of the client area. nCaretPosX = nCaretPosY = 0; nCurChar = 0; break; case VK_END: //...