Beranda > Delphi > How to tell Netscape Navigator which web pages to load from your Delphi program

How to tell Netscape Navigator which web pages to load from your Delphi program

Wouldn’t it be cool to have a hot key in your program that can activate and load a particular page (your home page on the web for example) into Netscape Navigator? Here’s how:

program Netscape;

uses
  DDEMan;

procedure GotoURL(sURL: string);
var
  dde: TDDEClientConv;
begin
  dde := TDDEClientConv.Create(nil);

  with dde do
  begin
    { specify the location of netscape.exe }
    ServiceApplication := 'c:\ns32\program\netscape.exe';

    { activate the Netscape Navigator }
    SetLink('Netscape', 'WWW_Activate');
    RequestData('0xFFFFFFFF');

    { go to the specified URL }
    SetLink('Netscape', 'WWW_OpenURL');
    RequestData(sURL + ',,0xFFFFFFFF,0x3,,,');

    { ... }

    CloseLink;
  end;

  dde.Free;
end;

begin
  GotoURL('http://www.chami.com/tips/');
end.
Iklan
Kategori:Delphi
  1. Belum ada komentar.
  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: