Solved

COM and Internet Explorer

Posted on 2000-05-10
1
167 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
code issue 8 129
Making delphi communicate with a c# service 16 103
select query - oracle 16 100
Multi-layered image in FireMonkey 9 33
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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