怎么将delphi上的组件和网页连接起来?

解决方案 »

  1.   

    费事一点的:
    function GetBrowserPath: string;
    var
      rgEPath: TRegistry;
    begin
      rgEPath := TRegistry.Create;
      rgEPath.RootKey := HKEY_CLASSES_ROOT;
      try
        rgEPath.OpenKey('HTTP\shell\open\command', False);
        Result := rgEPath.ReadString('');
        Result := Copy(Result, 2, Pos('" ', Result) - 2);
      finally
        rgEPath.Free;
      end;
    end;
    ...
    procedure TfrmReg.btnBuyClick(Sender: TObject);
    begin
      WinExec(PAnsiChar(GetBrowserPath + ' http://www.xxx.cn'), SW_NORMAL);
    end;
    省事的就用ShellApi中的ShellExecute,它会用当前已打开的IE窗口