🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #828

Setting Keyboard Focus to the CPPWebBrowser Window

#828
From: Mark Jacobs
Date: Thu, 09 Feb 2006 12:51
20 lines
2013 bytes
I am trying to set keyboard focus to the CPPWebBrowser window after a document has 
finished loading, or they hit the back or forward buttons in a toolbar just above the 
CPPWebBrowser window. I have tried various techniques, but I am at a loss as to how to 
correctly do this. My technique is to derive the handle of the browser window and use 
::SetFocus and/or SetActiveWindow, so that the browser window scrolls up and down in 
response to the mousewheel *and* the up and down arrow keys, without me having to click in 
the browser window somewhere first. The correct window handle is proving to be elusive. I 
use :-

   TPoint mousey;
   mousey.x=CppWebBrowser1->ClientOrigin.x+5; mousey.y=CppWebBrowser1->ClientOrigin.y+5;
   ::SetFocus(WindowFromPoint(mousey));

This works to an extent, but the browser window scrolls up and down in response to the 
mousewheel but not the up and down arrow keys, or vice versa.

Is there a more direct method of getting at CPPWebBrowser's real browser window handle?
-- 
Mark Jacobs
http://www.dkcomputing.co.uk
Technical Details
Message-ID: <43eb39fb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,a82dea7bc853ba4b,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 09 Feb 2006 12:51:53 +0000
From: Mark Jacobs <markj@critical.co.uk>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.web
Subject: Setting Keyboard Focus to the CPPWebBrowser Window
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.144.157.8
Message-ID: <43eb39fb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1139489275 81.144.157.8 (9 Feb 2006 04:47:55 -0700)
Lines: 20
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail