Solved

COM and Internet Explorer

Posted on 2000-05-10
1
161 Views
Last Modified: 2010-04-04
In examples Delphi on COM there is an example Web Browser.
 And how from the program to operate (control) activity Internet Explorer directly (For example to start at 11 hours www.rbc.ru)?.
0
Comment
Question by:doncov
1 Comment
 
LVL 3

Accepted Solution

by:
shenqw earned 50 total points
ID: 2796986
The Left thing is very easy,I think you can do it yourself.  :)

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,SHDocVw;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
  IEs:IShellWindows;
  IE:IWebBrowser;
  StartUpInfo: TStartUpInfo;
  ProcessInfo: TProcessInformation;
  hIE:THandle;
begin
  IEs:=CoShellWindows.Create as IShellWindows;
  if IEs.Count<1 then
  begin
    FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
    with StartupInfo do
    begin
      cb := SizeOf(TStartupInfo);
      dwFlags := STARTF_USESHOWWINDOW;
      wShowWindow := SW_SHOWNORMAL;
    end;
    if CreateProcess('C:\Program Files\Plus!\Microsoft Internet\IEXPLORE.EXE',
       nil, nil, nil, False,NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo) then
    begin
      hIE:=ProcessInfo.hProcess;
      while WaitForInputIdle(hIE,100)<>0 do Application.ProcessMessages;
      While IEs.Count<1 do Application.ProcessMessages;
    end;
  end;
  if IEs.Count>0 then
  begin
    IEs.Item(0).QueryInterface(IWebBrowser,IE);
    if IE<>nil then
    begin
      while IE.Busy do Application.ProcessMessages;
      IE.Navigate('http://www.experts-exchange.com',EmptyParam,EmptyParam,EmptyParam,EmptyParam);
    end;
  end;
end;

end.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now