Article View: borland.public.cppbuilder.nativeapi
Article #6131Re: Opening up Web Browsers inside my App
From: Gav
Date: Sun, 05 Jun 2005 12:57
Date: Sun, 05 Jun 2005 12:57
64 lines
3824 bytes
3824 bytes
Hi All,
Well I'm back with this old chestnut again, been busy with other stuff but
want to try and crack this again.
Just a recap for those that don't have the original messages to this thread
.
My original program opens a web page in multiple (selected and installed)
web browsers (IE, Opera, NS, Mozilla, Firefox and many more)
for cross-browser testing of that page/site. Each of these Browsers opens up
in their own window as they normally would.
I would 'like' for each of these Browsers to open up - still in their own
window and fully featured - but have each of those windows docked
inside my own application , preferably in a tabbed setup, so you can tab
between browsers (programs) within my app.
Originally I used ShellExecute to open up the browsers, but have been
advised (here) I need to use CreateProcess() so I can then grab the process
id (or whatever) of the Browser Window so I can redirect it into my
form/tabbed page Before it shows outside my program.
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.
I am now doing it like this (GetDefaultBrowser function defined earlier) :-
void __fastcall TMDIChild1::ITimageClick(TObject *Sender)
{
char DefaultBrowser[50];
MDIChild2->GetDefaultBrowser(DefaultBrowser);
//ShellExecute("parent", "Open", DefaultBrowser,
http://www.minitutorials.com ,NULL, SW_SHOWNORMAL); <== The old way !!
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset(&pi, 0, sizeof(pi));
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
CreateProcess(DefaultBrowser, http://www.minitutorials.com, 0, 0, 0, 0, 0,
0, &si, &pi);
}
Now, 'The old way' commented out worked fine and opened up the argument url,
the new way using CreateProcess does not. Now, I know the second argument of
CreateProcess is the command line version of the first, but I can not see
where else I would define my url I need the browser to open up at.
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 ...
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)
Needless to say I am searching for an answer, but as I have been working on
this for 2 years now (no joke!) some guidance would be a great help to me,
thanks very much.
Gav...
Technical Details
Message-ID:
<42a2f6aa$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.newsfeeds.com!news-in.superfeed.net!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>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,91b603800ded4d32 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Gav" <brightoncomputers@brightontown.com.au> Newsgroups: borland.public.cppbuilder.nativeapi References: <422926aa$1@newsgroups.borland.com> <422c31bd$1@newsgroups.borland.com> <422c515c@newsgroups.borland.com> <422c5d8e$1@newsgroups.borland.com> Subject: Re: Opening up Web Browsers inside my App Date: Sun, 5 Jun 2005 20:57:11 +0800 Lines: 66 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 203.121.204.130 Message-ID: <42a2f6aa$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1117976234 203.121.204.130 (5 Jun 2005 05:57:14 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail