아래처럼 프로시져를 추가하구요...
했는데요.... 모두다 잘 먹는데요..... 한가지가...
첨 폼이 로드되고나선 엔터키가 두번 눌러야 작동을 하더라구요...
그러고 나면... 담엔 한번만 눌러도... 동작을 하거든요....
이유가 멀까요?
procedure TFrm_Browser.MessageLoop(var Msg: TMsg; var Handled: Boolean);
const
DialogKeys: set of Byte
= [ VK_RETURN, VK_DELETE, VK_EXECUTE, VK_ESCAPE, VK_CANCEL,
VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT, VK_F10]; //VK_TAB,
MSJVMClassName = 'MSAWT_Comp_Class'; // for Java Applets
var
iOIPAO : IOleInPlaceActiveObject;
Dispatch: IDispatch;
Str : String;
begin
if (Web <> nil) and
((Msg.Message = WM_KEYDOWN) or (Msg.Message = WM_KEYUP)) and
(Msg.wParam in DialogKeys) then
begin
Handled := IsDialogMessage(Web.Handle, msg) = True;
SetLength(Str, MAX_PATH);
GetClassName(Msg.hwnd, PChar(Str), MAX_PATH);
SetLength (Str, StrLen (PChar(Str)));
if (Msg.wParam = VK_DELETE) and (Str = MSJVMClassName) then
else
if Handled then
if FOleInPlaceActiveObject <> nil then
FOleInPlaceActiveObject.TranslateAccelerator(Msg)
else
begin
Dispatch := Web.Application;
if Dispatch <> nil then
begin
Dispatch.QueryInterface(IOleInPlaceActiveObject, iOIPAO);
if iOIPAO <> nil then
FOleInPlaceActiveObject := iOIPAO;
end;
end;
end
else
Handled := False;
end;
procedure TFrm_Browser.FormCreate(Sender: TObject);
begin
Application.OnMessage := MessageLoop;
end;