Article View: borland.public.cppbuilder.nativeapi
Article #6135Re: Opening up Web Browsers inside my App
From: Bob Gonder
Date: Sun, 05 Jun 2005 18:55
Date: Sun, 05 Jun 2005 18:55
41 lines
2734 bytes
2734 bytes
Gav wrote: >So now I have CreateProcess opening up the chosen web browser(s) no >problem - trouble is I can not give it any arguments - I can not specify >which web site to open up to, it currently opens the default home page no >matter what I tell it. > >char DefaultBrowser[50]; Should probably be MAXPATH instead of 50. >CreateProcess(DefaultBrowser, http://www.minitutorials.com, 0, 0, 0, 0, 0, >0, &si, &pi); char Commandline[2048]; Might be better to use AnsiString because Commandline might be rather long. wsprintf(Commandline,"%s %s", DefaultBrowser, "http://www.minitutorials.com"); If you are going to use local files then I think you need quotes too.. wsprintf(Commandline,"%s \"%s\"", DefaultBrowser, "file:c:\\Documents and settings\\index.html"); CreateProcess(DefaultBrowser, Commandline, 0, 0, 0, 0, 0, 0, &si, &pi); >The above is a new problem to my original and although a neccesary fix is >required , is not as important as knowing what to do next ... Sorry, don't know what to do next...... The si will let you set the window size and position. It will also let you start the browser in suspended mode. I think ResumeThread( pi.hThread) will let it run. How you get it to attach and stay inside your frame, I don't know. >Assuming CreateProcess() is working , which it is to a point, how do I then >locate the process as it starts and redirect it (dock it) into my >application inside a tabbed page or form.? ( I will need to do this for all >Browser processes as they open, stick them in their own tab or form)
Technical Details
Message-ID:
<q5h6a1phmn8aln5t07eoel1hr0c5gpv2ml@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<422926aa$1@newsgroups.borland.com> <422c31bd$1@newsgroups.borland.com> <422c515c@newsgroups.borland.com> <422c5d8e$1@newsgroups.borland.com> <42a2f6aa$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,91b603800ded4d32 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Opening up Web Browsers inside my App Date: Sun, 05 Jun 2005 11:55:57 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <q5h6a1phmn8aln5t07eoel1hr0c5gpv2ml@4ax.com> References: <422926aa$1@newsgroups.borland.com> <422c31bd$1@newsgroups.borland.com> <422c515c@newsgroups.borland.com> <422c5d8e$1@newsgroups.borland.com> <42a2f6aa$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.77.36.213 X-Trace: newsgroups.borland.com 1117997755 67.77.36.213 (5 Jun 2005 11:55:55 -0700) Lines: 43 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail