H
hui717
Unregistered / Unconfirmed
GUEST, unregistred user!
声明<br>var<br> EventArr:array[0..1000] of EVENTMSG;<br><br>钩子函数<br>function HookProc(iCode:Integer;wParam:WPARAM;lParam:LPARAM):LRESULT;stdcall; //记录操作<br>begin<br> recOK:=1;<br> Result:=0;<br> if iCode < 0 then<br> Result:=CallNextHookEx(hHook,iCode,wParam,lParam)<br> else if iCode = HC_SYSMODALON then<br> recOK:=0<br> else if iCode = HC_SYSMODALOFF then<br> recOK:=1<br> else if ((recOK>0) and (iCode = HC_ACTION)) then<br> begin<br> EventArr[EventLog]:=PEventMSG(lParam)^;<br> EventLog:=EventLog+1;<br> if EventLog >=1000 then<br> begin<br> UnhookWindowsHookEx(hHook)<br> end;<br> end;<br>end;<br><br>现在我想显示记录<br> for i:=0 to Low(EventArr) do<br> begin<br> str:=str+EventArr;<br> end;<br> MessageBox(self.Handle,PChar(str),'系统提示',MB_ICONINFORMATION);<br><br>但提示:<br>[Error] uServer.pas(196): Incompatible types: 'String' and 'tagEVENTMSG'错误<br>该如何转换呀<br><br>请高手帮帮忙