Delphi-webbrowser failure of direction keys after flash Loading

Source: Internet
Author: User

Original article: http://blog.csdn.net/dropme/article/details/6253528

 

Put an applicationevent control on the form, which is written in the onmessage event.

 

uses  ActiveX;procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);const  StdKeys = [VK_TAB, VK_RETURN, VK_BACK]; { standard keys }  ExtKeys = [VK_DELETE, VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN]; { extended keys }  fExtended = $01000000; { extended key flag }var  CurrentEWB: TEmbeddedWB;begin  Handled := False;  CurrentEWB := EmbeddedWB1;  if Assigned(CurrentEWB) then    if IsChild(CurrentEWB.Handle, Msg.Hwnd) then    begin      Handled := (IsDialogMessage(CurrentEWB.Handle, Msg) = True);      if Handled and not CurrentEWB.Busy then        if ((Msg.Message >= WM_KEYFIRST) and (Msg.Message <= WM_KEYLAST)) and          ((Msg.wParam in StdKeys) or (GetKeyState(VK_CONTROL) < 0) or (Msg.wParam in ExtKeys) and          ((Msg.lParam and fExtended) = fExtended)) then        begin          Handled := (CurrentEWB.Application as IOleInPlaceActiveObject).TranslateAccelerator(Msg) = S_OK;          if not Handled then          begin            Handled := True;            TranslateMessage(Msg);            DispatchMessage(Msg);          end;        end;    end;end;

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.