Article View: borland.public.cppbuilder.nativeapi
Article #7127Re: Opening up Web Browsers inside my App
From: Gav
Date: Mon, 14 Mar 2005 14:57
Date: Mon, 14 Mar 2005 14:57
51 lines
2742 bytes
2742 bytes
Ok, I have not really got any further with this.
How I am approaching it at the moment (which is probably wrong) is like this
.
A user checks checkbox(s) to choose which browser(s) to open typed URL -
'mystring' declared earlier :
char mystring[50];
AnsiString A = AnsiString(ComboBox2->Text);
strcpy(mystring, A.c_str());
Then I currently open it up using ShellExecute method.
I want to open the Browser in either my Form or a Tabbed page instead of the
ShellExecute opening it up in a new Browser Window.
As far as I can see, I still need to open it using ShellExecute first in
order to determine the WindowText (But the window still opens which I dont
want) - then I grab the Window and stick it in my Form/Tab.
So :-
if (CheckBox2->Checked==true) {ShellExecute("parent", "Open",
"Iexplore.exe", mystring , iexplorePath, SW_MAXIMIZE),z=1;
AnsiString TheCaption = "The WindowText I need to match";
HWND hWnd = FindWindow(0, TheCaption.c_str() );
if ( hWnd)
{
::SetParent ( hWnd, PagesDlg->TabSheet2->Handle );
}
else ShowMessage( TheCaption + "\n\nnot found");
PagesDlg->Show();
}
I think I need to use GetWindowText() somewhere and assign that to be
TheCaption.
How do I look for the WindowText of the window just opened by the
ShellExecute method?
Is ShellExecute the best way to do this or is another method preferred -
considering I dont actually want
the window open in its own space anyway, just straight into thr TabSheet or
Form.?
Any pointers anyone on how to approach this.?
(I still don't see where GetClassName() would help me in all of this)
Thanks.
Gav...
Technical Details
Message-ID:
<4235a656$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<422926aa$1@newsgroups.borland.com> <422c31bd$1@newsgroups.borland.com> <422c515c@newsgroups.borland.com> <422c7e08$1@newsgroups.borland.com> <422ce3f2$1@newsgroups.borland.com> <422d6840$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> <422c7e08$1@newsgroups.borland.com> <422ce3f2$1@newsgroups.borland.com> <422d6840$1@newsgroups.borland.com> Subject: Re: Opening up Web Browsers inside my App Date: Mon, 14 Mar 2005 22:57:22 +0800 Lines: 53 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 203.121.204.130 Message-ID: <4235a656$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1110812246 203.121.204.130 (14 Mar 2005 06:57:26 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail