[阅读: 501] 2007-09-20 02:44:14
IInputObject的TranslateAcceleratorIO方法,原先我是这样实现的:
function TBandUnit.TranslateAcceleratorIO(var lpMsg: TMsg): HResult;
begin
if (lpMsg.WParam <> VK_TAB) then begin
TranslateMessage(lpMSg);
DispatchMessage(lpMsg);
Result := S_OK;
end
else Result := S_FALSE;}
end;
后来改成这样就好了,
function TBandUnit.TranslateAcceleratorIO(var lpMsg: TMsg): HResult;
var
nVirtKey: integer;
begin
nVirtKey := integer(lpMsg.WParam);
if (lpMsg.message = WM_KEYUP) and (nVirtKey = VK_RETURN) then
begin
///.......
Result := S_OK;
end
else
if ((lpMsg.message = WM_KEYUP) or (lpMsg.message = WM_KEYDOWN))
and ((nVirtKey = VK_BACK) or ((VK_END <= nVirtKey) and (VK_DOWN >= nVirtKey))
or (nVirtKey = VK_DELETE)) then
begin
TranslateMessage(lpMSg);
DispatchMessage(lpMsg);
Result := S_OK;
end
else Result := S_FALSE;
end;
有些不明白,大牛们给讲讲

机器人,
这首歌学会了没有?

我们的目标是->没有蛀牙!
