🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
1 messages
1 total messages Started by Mark Jacobs Thu, 09 Feb 2006 12:51
Setting Keyboard Focus to the CPPWebBrowser Window
#828
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads