🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6127

Re: Opening up Web Browsers inside my App

#6127
From: Gav
Date: Sat, 11 Jun 2005 09:37
60 lines
3336 bytes
> "Remy Lebeau (TeamB)" wrote :-
>
>> You are not passing the correct HANDLE parameter to WaitForInputIdle(), 
>> and
>> you are only waiting for a fraction of a second overall.  That is too 
>> short
>> a time.  Get rid of the Sleep() and use a much larger timeout on
>> WaitForInputIdle(), or just use INFINITE.  As for the HANDLE parameter to
>> WaitForInputIdle(), you need to use the hProcess member of the
>> PROCESS_INFORMATION structure.

<snip>

>>  Pass in the correct HANDLE, and then it
>> will work.

I have done what I think to be right here, sorry to be harping on
about it, but can you tell me why in my case it does not work
using the code below seems to me to be right for what you say
and from other sources.


> void __fast TMDIChild1::ITimageClick(TObject *Sender)
> {
> char DefaultBrowser[MAX_PATH+1] = {0};
>        MDIChild2->GetDefaultBrowser(DefaultBrowser);
>
>        STARTUPINFO si = {sizeof(STARTUPINFO), 0};
>        PROCESS_INFORMATION pi = {0};
>
>        AnsiString CmdLine = (AnsiQuotedStr(DefaultBrowser, '"') + " " +
>        AnsiQuotedStr("http://www.minitutorials.com", '"'));
>
>        if( ::CreateProcess(NULL, CmdLine.c_str(), NULL, NULL, FALSE, 0,
>        NULL, NULL, &si, &pi) )
>        {
>          WaitForInputIdle(pi.hProcess, INFINITE);
>          ::CloseHandle(pi.hThread);
>          ::CloseHandle(pi.hProcess);
>          MyInfo info = {pi.dwProcessId, NULL};
> 
> ::EnumWindows((WNDENUMPROC)FindBrowser,reinterpret_cast<LPARAM>(&info));
>
>          if( info.hWnd != NULL )
>             {
>             ::SetParent ( info.hWnd, Form4->Handle );
>             Form4->Show();
>             }
>
>          }
>
> }

Am I using SetParent correctly or not?
Is the correct handle being passed into info?

Thanks

Gav... 
Technical Details
Message-ID: <42aab0bd@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
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> <42a3910a$1@newsgroups.borland.com> <42a44aa2$1@newsgroups.borland.com> <42a4855c$1@newsgroups.borland.com> <42a588ed@newsgroups.borland.com> <42a5a49d@newsgroups.borland.com> <42a5bb59$1@newsgroups.borland.com> <42a5bdbf@newsgroups.borland.com> <42a5d4dd@newsgroups.borland.com> <42a62b57@newsgroups.borland.com> <42a63c20$1@newsgroups.borland.com> <42a6e629$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> <42a2f6aa$1@newsgroups.borland.com> <42a3910a$1@newsgroups.borland.com> <42a44aa2$1@newsgroups.borland.com> <42a4855c$1@newsgroups.borland.com> <42a588ed@newsgroups.borland.com> <42a5a49d@newsgroups.borland.com> <42a5bb59$1@newsgroups.borland.com> <42a5bdbf@newsgroups.borland.com> <42a5d4dd@newsgroups.borland.com> <42a62b57@newsgroups.borland.com> <42a63c20$1@newsgroups.borland.com> <42a6e629$1@newsgroups.borland.com>
Subject: Re: Opening up Web Browsers inside my App
Date: Sat, 11 Jun 2005 17:37:00 +0800
Lines: 62
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: <42aab0bd@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1118482621 203.121.204.130 (11 Jun 2005 02:37:01 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail