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:ns32programnetscape.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.
Listing #1 : Delphi code. Download
callns (0.47 KB).
Applicable Keywords : Delphi, Delphi 2.x, Delphi 3.x, Functions, Internet, Netscape Navigator, Navigator 2.x, Navigator 3.x, Communicator 4.x, Source Code, World Wide Web