From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,d4d10419e687b087 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-13 03:41:09 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!newsfeed.icl.net!nntp.news.xara.net!xara.net!gxn.net!server6.netnews.ja.net!server4.netnews.ja.net!server2.netnews.ja.net!newshost.central.susx.ac.uk!news.bton.ac.uk!not-for-mail From: John English Newsgroups: comp.lang.ada Subject: Re: About lauching files on Win98 Date: Tue, 13 Feb 2001 11:33:50 +0000 Organization: University of Brighton Message-ID: <3A891B9E.A89D9266@bton.ac.uk> References: NNTP-Posting-Host: straumli.it.bton.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: saturn.bton.ac.uk 982064010 13562 193.62.183.204 (13 Feb 2001 11:33:30 GMT) X-Complaints-To: news@bton.ac.uk NNTP-Posting-Date: 13 Feb 2001 11:33:30 GMT X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:5215 Date: 2001-02-13T11:33:30+00:00 List-Id: "Beard, Frank" wrote: > > St�phane, > > The simplest way to launch the program from the application is to use > the WinExec API. It has been superceded by the more complicated > CreateProcess API, but I doubt if it will go away any time soon, > if ever. > > Depending on your Windows API binding (we are using Aonix which I > think uses Intermetrics' binding), it will look something like: > > command : string := "iexplore.exe help.html" & ASCII.NUL; I beg to differ. It is better to start the default browser using ShellExecute than to assume the user has IE installed and that the installation directory is in the user's path. To use ShellExecute via the Win32 binding, try something like this (not tested!): Win32.WinDef.HINSTANCE hInst := Win32.ShellAPI.ShellExecute( System.Null_Address, -- no parent window To_LPCSTR("open" & ASCII.NUL), -- command To_LPCSTR("c:\help.html" & ASCII.NUL), -- file to open System.Null_Address, -- no parameters System.Null_Address, -- no default directory Win32.WinUser.SW_SHOWNORMAL -- show window normally ); The return value is a handle to the instance of the application that was started (or a value <= 32 if an error occurred, but you'll need to do an Unchecked_Conversion from Win32.WinDef.HINSTANCE, which is basically a System.Address, to an Integer to check for this). HTH, ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------