L
l1_jun
Unregistered / Unconfirmed
GUEST, unregistred user!
如题,我编写了一个包含Dhtmledit的Exe程序和一个Dll模块,在这两个中使用快捷键都没有问题,但是在Com中的代码跟上述两个是一样的,却无法使用快捷键。
请问各位高手,这种问题有没有遇到过?如何解决?
下面是我已用的两种方法(无效):
1)
initialization
OleInitialize(nil);
finalization
OleUninitialize;
2)主要代码如下,部分没贴上:
var
iOIPAO: IOleInPlaceActiveObject;
Dispatch: IDispatch;
begin
Handled := False;
if HTMLEdt = nil then
Exit;
Handled := (IsDialogMessage(HTMLEdt.Handle, Msg) = True);
if (Handled) and (not HTMLEdt.Busy) then
begin
if FOleInPlaceActiveObject = nil then
begin
Dispatch := HTMLEdt.ControlInterface;
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_KEYDOWN) or (Msg.message = WM_KEYUP)) and
((Msg.wParam = VK_BACK) or (Msg.wParam = VK_LEFT) or (Msg.wParam = VK_RIGHT)) then
//nothing -do
not pass on Backspace, Left or Right arrows
else
FOleInPlaceActiveObject.TranslateAccelerator(Msg);
end
else
Handled := False;
end;
请问各位高手,这种问题有没有遇到过?如何解决?
下面是我已用的两种方法(无效):
1)
initialization
OleInitialize(nil);
finalization
OleUninitialize;
2)主要代码如下,部分没贴上:
var
iOIPAO: IOleInPlaceActiveObject;
Dispatch: IDispatch;
begin
Handled := False;
if HTMLEdt = nil then
Exit;
Handled := (IsDialogMessage(HTMLEdt.Handle, Msg) = True);
if (Handled) and (not HTMLEdt.Busy) then
begin
if FOleInPlaceActiveObject = nil then
begin
Dispatch := HTMLEdt.ControlInterface;
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_KEYDOWN) or (Msg.message = WM_KEYUP)) and
((Msg.wParam = VK_BACK) or (Msg.wParam = VK_LEFT) or (Msg.wParam = VK_RIGHT)) then
//nothing -do
not pass on Backspace, Left or Right arrows
else
FOleInPlaceActiveObject.TranslateAccelerator(Msg);
end
else
Handled := False;
end;