CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    17

    How to get scrolled area in IE when scrolled by hooking SendMessage()

    Hi,

    We are developing a C# windows application which scrolls the selected windows automatically by using(hooking) win32 SendMessage() function and later will display the no. of pixels scrolled using GetScrollInfo() function.

    The SendMessage() is working properly & is scrolling all windows including IE. But GetScrollInfo() is not working for IE as IE doesnot uses win32 scroll bars. So we are facing the following issues :

    (1) When the IE window is being scrolled the SendMessage() will be called infinitely because we are not able to put the condition as we dont know the max scrollable size of the window.
    (For other windows we are getting it by 'SCROLLINFO' structure and GetScrollInfo() function.)

    (2) We tried with ---- mshtml.dll
    - On the occurance of "mshtml.HTMLWindowEvents2_Event.onscroll" event , we are getting
    "mshtml.IHTMLElement2.scrolltop" value & it is giving us the present scrollbar top position....when we scroll manually. But if we scroll the IE window by hooking SendMessage() function....IE window will scroll but the 'HTMLWindowEvents2_Event.onscroll' will not be called & 'mshtml.IHTMLElement2.scrolltop' value will not be available.
    But while the IE window is being scrolled automatically.....if we click once on scroll bar thumb it gives us the 'mshtml.IHTMLElement2.scrolltop' value....

    So we are not finding any why to get scrolled area in IE after completion of automatic scrolling...

    Please help us in this regard.

    Thank you.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to get scrolled area in IE when scrolled by hooking SendMessage()

    You can do this by using Active Accessibility.

  3. #3
    Join Date
    Jan 2010
    Posts
    17

    Smile Re: How to get scrolled area in IE when scrolled by hooking SendMessage()

    Hi Arjay,
    We are thankful for your quick reply.

    We downloded the Active accessibility tools from MS site i.e. accevent32.exe,event32.dll...etc. and tried to get the required information.

    When the notepad window is scrolled by hooking SendMessage() those tools will give the exact scroll bar position as below :

    OBJ_VALUECHANGE Name="Vertical" Value="13" Role=scroll bar State=normal
    OBJ_VALUECHANGE Name="Vertical" Value="20" Role=scroll bar State=normal.......

    but when the IE window is scrolled it will give the following values :

    (unknown) Name="Microsoft Active Accessibility - Wikipedia, the free encyclopedia" Role=pane State=read only,focusable

    (unknown) Name="Microsoft Active Accessibility - Wikipedia, the free encyclopedia" Role=pane State=read only,focusable

    These tools are also not able to get the 'scrolled event' (as you can see it listed the event as 'unknown') and scroll bar value.

    Please suggest how to use 'Active Accessibility' for our requirement.

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured