Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TCppWebBrowser ENTER key

42 views
Skip to first unread message

Arka Roy

unread,
Aug 6, 2001, 11:54:17 AM8/6/01
to
I am a newbie C++ Builder 5.0 user making a customized browser using the
TCppWebBrowser component.

The browsing seems to work fine, but when a page has an HTML input field and
I type into it, pressing the ENTER key seems to have no effect.

Does anyone know the reason for this, and what can be done about it? Any
help would be highly appreciated.

Thanks in advance.
Arka Roy

Aaron Bockover

unread,
Aug 7, 2001, 5:31:46 PM8/7/01
to
Arka,
Although I do not have a solution, I have the same problem. I have found
absolutely no help on this topic, it's as if it doesn't exist! I really wish
someone knew what to do about it. I have posted this question many times in
this (and other) newsgroups and have gotten no response. I didn't mean to
get your hopes up ;-)

Please someone, if you know how to solve this problem, tell us!

More info (Arka: maybe you can relate?):

- I installed the TCppWebBrowser as an ActiveX component
- I did not at the time have a professional version of C++ Builder (5)

-Aaron


Alex Bakaev [TeamB]

unread,
Aug 7, 2001, 6:55:20 PM8/7/01
to
I suggest looking with a message spying tool like Spy++ or WinSight to
see who consumes the enter key. Then subclassing a window proc may be
the answer. I've done that for other keys in a similar situation. Search
these groups for a post from me that includes a word 'subclass'

hth,
.a

Aaron Bockover wrote:
[snip]

Arka Roy

unread,
Aug 20, 2001, 5:49:25 AM8/20/01
to

Just letting you all know I finally found a solution to this problem. Here it is:

IN HEADER FILE
//////////////////////////////////////////////

__published:
TCppWebBrowser *CppWebBrowser1;

private:
void __fastcall MyMessageHandler(tagMSG &Msg, bool &Handled);
IOleInPlaceActiveObject *OleInPlaceActiveObject;

//--------------------------------------------


IN SOURCE FILE
//////////////////////////////////////////////

__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Application->OnMessage = MyMessageHandler;
}

//--------------------------------------------

void __fastcall TForm1::MyMessageHandler(tagMSG &Msg, bool &Handled)
{
if( Msg.message == WM_RBUTTONDOWN || Msg.message == WM_RBUTTONDBLCLK )
Handled = true;

else if( CppWebBrowser1 &&
(Msg.message == WM_KEYDOWN || Msg.message == WM_KEYUP) &&
(Msg.wParam == VK_RETURN || Msg.wParam == VK_EXECUTE) )
{
Handled = IsDialogMessage(CppWebBrowser1->Handle, &Msg);
if (Handled)
{
if( !OleInPlaceActiveObject )
CppWebBrowser1->Application->QueryInterface( IID_IOleInPlaceActiveObject, (void **)&OleInPlaceActiveObject );

if( OleInPlaceActiveObject )
OleInPlaceActiveObject->TranslateAccelerator(&Msg);
}
}

else
Handled = false;
}

//--------------------------------------------

Additionally, I got another solution from Borland's support. I didn't use it because it would have been a big risky job to change components at this point in my schedule. Here it is for anyone who is interested. Since I didn't actually try it unfortunately I won't be able to answer any detailed questions you may have.

======= Borland-suggested solution
Use the THTML component instead of TCppWebBrowser. Please do the following to register the THTML component.

Import the C++Builder 4 NetMasters HTML.OCX
(located on the C++Builder 5 CD-ROM in Info\Extras\NetManage).

Install NetManage OCX components:

1. Copy the files Html.ocx, *.dll to the Windows\System directory.

2. Go to Component | Import ActiveX Control | Add
(Select HTML.OCX control)

3. Select the palette page as you wish (for example Internet)

4. Then Click Install and continue clicking OK or YES
if any dialog box appears

5. Then saves the changes to the project .

After this, the control will get automatically registered.
Now you can find HTML component in the Internet page.

-------------------------------------------

Note :

TCppWebBrowser wraps the IWebBrowser2 interface from Microsoft’s Shell Doc Object and Control Library (SHDOCVW.DLL) to allow you to create a customized Web browsing application.

But THTML component uses ActiveX from a 3rd party (Netmanage).

=======================================================

0 new messages