🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: CppWebBrowser scroll html page

#1273
From: Mark Jacobs
Date: Thu, 27 Sep 2007 12:34
32 lines
2103 bytes
"Andrea Cremonini" <andrea@jpolis.com> wrote in message 
news:46f7b98e$1@newsgroups.borland.com...
> I'm using TCppWebBrowser with C++ Builder 5 Pro...
> I have to scroll html page inside the component by buttons on my form,
> but I don't know how can I do...

Here is a routine that generically scrolls any control with a vertical 
scrollbar up or down :-

void scrllctrl(TWinControl *mjctl,bool goup)
{
  tagPOINT mpt,clcrds;
  GetCursorPos(&mpt);
  clcrds.x=mjctl->Width-7;
  clcrds.y = (goup) ? 7 : mjctl->Height-7;
  ClientToScreen(mjctl->Handle,&clcrds);
  SetCursorPos(clcrds.x,clcrds.y);
  mouse_event(MOUSEEVENTF_LEFTDOWN,clcrds.x,clcrds.y,0,0);
  mouse_event(MOUSEEVENTF_LEFTUP,clcrds.x,clcrds.y,0,0);
  Application->ProcessMessages();
  SetCursorPos(mpt.x,mpt.y);
}

Simply use
scrllctrl(CppWebBrowser1,true); to scroll it up and
scrllctrl(CppWebBrowser1,false); to scroll it down.

HTH,
-- 
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
Technical Details
Message-ID: <46fba352$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!194.134.4.77.MISMATCH!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <46f7b98e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c7de9029d71fa0c7
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mark Jacobs" <http://www.jacobsm.com/mjmsg.htm?BorlandNG>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <46f7b98e$1@newsgroups.borland.com>
Subject: Re: CppWebBrowser scroll html page
Date: Thu, 27 Sep 2007 13:34:25 +0100
Lines: 34
Organization: DK Computing
MIME-Version: 1.0
Content-Type: text/plain;
 format=flowed;
 charset="iso-8859-1";
 reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 81.144.157.8
Message-ID: <46fba352$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1190896466 81.144.157.8 (27 Sep 2007 05:34:26 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!194.134.4.77.MISMATCH!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail