D
deadman
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TClientFrmMain.MsgHandler(var msg: TMsg; var Handled: Boolean);
const
DialogKeys: set of Byte = [VK_LEFT, VK_RIGHT];
var
iOIPAO: IOleInPlaceActiveObject;
Dispatch: IDispatch;
begin
if (WebBrowser1 = nil) then
begin
Handled := System.false;
Exit;
end;
Handled := (IsDialogMessage(WebBrowser1.Handle, msg) = System.True);
if (Handled) and (not WebBrowser1.Busy) then
begin
if FOleInPlaceActiveObject = nil then
begin
Dispatch := WebBrowser1.Application;
if Dispatch <> nil then
begin
Dispatch.QueryInterface(IOleInPlaceActiveObject, iOIPAO);
if iOIPAO <> nil then
FOleInPlaceActiveObject := iOIPAO;
end;
end;
if FOleInPlaceActiveObject <> nil then
if (msg.Message = WM_KEYUP) and (msg.wParam in DialogKeys) then
//
else
FOleInPlaceActiveObject.TranslateAccelerator(msg);
end;
end;
这段代码大概意思是: 当按下左右键不做处理,当按下其他键后执行 FOleInPlaceActiveObject.TranslateAccelerator(msg);
小弟 在jsp页面的一个输入框里按下back键后会退掉 2个字符,怎么回事呢?好象back键系统默认有退格事件啊?
比如说输入框里有 333 按一次 back后就剩 3 了,我的结果是要 33
如果我在DialogKeys: set of Byte = [VK_LEFT, VK_RIGHT]; 把VK_BACK 加上的话就不会执行FOleInPlaceActiveObject.TranslateAccelerator(msg); 但是能得到我要的 33结果
可又必须要有执行FOleInPlaceActiveObject.TranslateAccelerator(msg);
不知道怎么办了,有什么办法把back的消息拦截掉?
const
DialogKeys: set of Byte = [VK_LEFT, VK_RIGHT];
var
iOIPAO: IOleInPlaceActiveObject;
Dispatch: IDispatch;
begin
if (WebBrowser1 = nil) then
begin
Handled := System.false;
Exit;
end;
Handled := (IsDialogMessage(WebBrowser1.Handle, msg) = System.True);
if (Handled) and (not WebBrowser1.Busy) then
begin
if FOleInPlaceActiveObject = nil then
begin
Dispatch := WebBrowser1.Application;
if Dispatch <> nil then
begin
Dispatch.QueryInterface(IOleInPlaceActiveObject, iOIPAO);
if iOIPAO <> nil then
FOleInPlaceActiveObject := iOIPAO;
end;
end;
if FOleInPlaceActiveObject <> nil then
if (msg.Message = WM_KEYUP) and (msg.wParam in DialogKeys) then
//
else
FOleInPlaceActiveObject.TranslateAccelerator(msg);
end;
end;
这段代码大概意思是: 当按下左右键不做处理,当按下其他键后执行 FOleInPlaceActiveObject.TranslateAccelerator(msg);
小弟 在jsp页面的一个输入框里按下back键后会退掉 2个字符,怎么回事呢?好象back键系统默认有退格事件啊?
比如说输入框里有 333 按一次 back后就剩 3 了,我的结果是要 33
如果我在DialogKeys: set of Byte = [VK_LEFT, VK_RIGHT]; 把VK_BACK 加上的话就不会执行FOleInPlaceActiveObject.TranslateAccelerator(msg); 但是能得到我要的 33结果
可又必须要有执行FOleInPlaceActiveObject.TranslateAccelerator(msg);
不知道怎么办了,有什么办法把back的消息拦截掉?