Delphi automatically scroll to the bottom of Scroll

Source: Internet
Author: User

Automatically scroll to the bottom of Scroll

UsesMshtml;
{$ R *. DFM}
VaR
Scrollpos: integer = 0;
ProcedureTform1.button1click (Sender: tobject );
Begin
INC (scrollpos, 10 );
IfWebbrowser1.document <>Nil Then
(Webbrowser1.document as ihtmldocument2). parentwindow. Scroll (0, scrollpos );
End;// *********************************************************************//
// Interface: IHTMLWindow2
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {332C4427-26CB-11D0-B483-00C04FD90119}
// *********************************************************************//
  IHTMLWindow2 = interface(IHTMLFramesCollection2)
    [‘{332C4427-26CB-11D0-B483-00C04FD90119}‘]
    function Get_frames: IHTMLFramesCollection2; safecall;
    procedure Set_defaultStatus(const p: WideString); safecall;
    function Get_defaultStatus: WideString; safecall;
    procedure Set_status(const p: WideString); safecall;
    function Get_status: WideString; safecall;
    function setTimeout(const expression: WideString; msec: Integer; var language: OleVariant): Integer; safecall;
    procedure clearTimeout(timerID: Integer); safecall;
    procedure alert(const message: WideString); safecall;
    function confirm(const message: WideString): WordBool; safecall;
    function prompt(const message: WideString; const defstr: WideString): OleVariant; safecall;
    function Get_Image: IHTMLImageElementFactory; safecall;
    function Get_location: IHTMLLocation; safecall;
    function Get_history: IOmHistory; safecall;
    procedure close; safecall;
    procedure Set_opener(p: OleVariant); safecall;
    function Get_opener: OleVariant; safecall;
    function Get_navigator: IOmNavigator; safecall;
    procedure Set_name(const p: WideString); safecall;
    function Get_name: WideString; safecall;
    function Get_parent: IHTMLWindow2; safecall;
    function open(const url: WideString; const name: WideString; const features: WideString; 
                  replace: WordBool): IHTMLWindow2; safecall;
    function Get_self: IHTMLWindow2; safecall;
    function Get_top: IHTMLWindow2; safecall;
    function Get_window: IHTMLWindow2; safecall;
    procedure navigate(const url: WideString); safecall;
    procedure Set_onfocus(p: OleVariant); safecall;
    function Get_onfocus: OleVariant; safecall;
    procedure Set_onblur(p: OleVariant); safecall;
    function Get_onblur: OleVariant; safecall;
    procedure Set_onload(p: OleVariant); safecall;
    function Get_onload: OleVariant; safecall;
    procedure Set_onbeforeunload(p: OleVariant); safecall;
    function Get_onbeforeunload: OleVariant; safecall;
    procedure Set_onunload(p: OleVariant); safecall;
    function Get_onunload: OleVariant; safecall;
    procedure Set_onhelp(p: OleVariant); safecall;
    function Get_onhelp: OleVariant; safecall;
    procedure Set_onerror(p: OleVariant); safecall;
    function Get_onerror: OleVariant; safecall;
    procedure Set_onresize(p: OleVariant); safecall;
    function Get_onresize: OleVariant; safecall;
    procedure Set_onscroll(p: OleVariant); safecall;
    function Get_onscroll: OleVariant; safecall;
    function Get_document: IHTMLDocument2; safecall;
    function Get_event: IHTMLEventObj; safecall;
    function Get__newEnum: IUnknown; safecall;
    function showModalDialog(const dialog: WideString; var varArgIn: OleVariant; 
                             var varOptions: OleVariant): OleVariant; safecall;
    procedure showHelp(const helpURL: WideString; helpArg: OleVariant; const features: WideString); safecall;
    function Get_screen: IHTMLScreen; safecall;
    function Get_Option: IHTMLOptionElementFactory; safecall;
    procedure focus; safecall;
    function Get_closed: WordBool; safecall;
    procedure blur; safecall;
    procedure scroll(x: Integer; y: Integer); safecall;
    function Get_clientInformation: IOmNavigator; safecall;
    function setInterval(const expression: WideString; msec: Integer; var language: OleVariant): Integer; safecall;
    procedure clearInterval(timerID: Integer); safecall;
    procedure Set_offscreenBuffering(p: OleVariant); safecall;
    function Get_offscreenBuffering: OleVariant; safecall;
    function execScript(const code: WideString; const language: WideString): OleVariant; safecall;
    function toString: WideString; safecall;
    procedure scrollBy(x: Integer; y: Integer); safecall;
    procedure scrollTo(x: Integer; y: Integer); safecall;
    procedure moveTo(x: Integer; y: Integer); safecall;
    procedure moveBy(x: Integer; y: Integer); safecall;
    procedure resizeTo(x: Integer; y: Integer); safecall;
    procedure resizeBy(x: Integer; y: Integer); safecall;
    function Get_external: IDispatch; safecall;
    property frames: IHTMLFramesCollection2 read Get_frames;
    property defaultStatus: WideString read Get_defaultStatus write Set_defaultStatus;
    property status: WideString read Get_status write Set_status;
    property Image: IHTMLImageElementFactory read Get_Image;
    property location: IHTMLLocation read Get_location;
    property history: IOmHistory read Get_history;
    property opener: OleVariant read Get_opener write Set_opener;
    property navigator: IOmNavigator read Get_navigator;
    property name: WideString read Get_name write Set_name;
    property parent: IHTMLWindow2 read Get_parent;
    property self: IHTMLWindow2 read Get_self;
    property top: IHTMLWindow2 read Get_top;
    property window: IHTMLWindow2 read Get_window;
    property onfocus: OleVariant read Get_onfocus write Set_onfocus;
    property onblur: OleVariant read Get_onblur write Set_onblur;
    property onload: OleVariant read Get_onload write Set_onload;
    property onbeforeunload: OleVariant read Get_onbeforeunload write Set_onbeforeunload;
    property onunload: OleVariant read Get_onunload write Set_onunload;
    property onhelp: OleVariant read Get_onhelp write Set_onhelp;
    property onerror: OleVariant read Get_onerror write Set_onerror;
    property onresize: OleVariant read Get_onresize write Set_onresize;
    property onscroll: OleVariant read Get_onscroll write Set_onscroll;
    property document: IHTMLDocument2 read Get_document;
    property event: IHTMLEventObj read Get_event;
    property _newEnum: IUnknown read Get__newEnum;
    property screen: IHTMLScreen read Get_screen;
    property Option: IHTMLOptionElementFactory read Get_Option;
    property closed: WordBool read Get_closed;
    property clientInformation: IOmNavigator read Get_clientInformation;
    property offscreenBuffering: OleVariant read Get_offscreenBuffering write Set_offscreenBuffering;
    property external: IDispatch read Get_external;
  end;


From Weizhi note (wiz)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.