1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, OleCtrls, SHDocVw,ComCtrls, ActiveX, AppEvnts;
type TForm1 = class(TForm) WebBrowser1: TWebBrowser; pnl1: TPanel; btn1: TButton; ApplicationEvents1: TApplicationEvents; procedure btn1Click(Sender: TObject); procedure ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); private public end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject); begin WebBrowser1.Navigate('http://demochat.dc10-soft.de/flashchat.php'); end;
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); const StdKeys = [VK_TAB, VK_RETURN,VK_BACK]; ExtKeys = [VK_DELETE, VK_BACK, VK_LEFT, VK_RIGHT]; fExtended = $01000000;
begin if IsChild(WebBrowser1.Handle, Msg.Hwnd) then begin if (Msg.Message = WM_CLOSE) then msg.Message := 0 else 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 := (WebBrowser1.Application as IOleInPlaceActiveObject).TranslateAccelerator(Msg) = S_OK; if not Handled then begin Handled := True; TranslateMessage(Msg); DispatchMessage(Msg); end; end; end; end; |