Jump to content
shelly

How to detect pop-up have scroll bar or not?

Recommended Posts

On 10/3/2016 at 8:59 AM, jguinch said:

Can you try this code ?
It lists all controls in the specified window an uses _GUIScrollBars_GetScrollInfo for each control. It works for me with notepad, but not tested with anoter app.

#include <GuiScrollBars.au3>


If _WinDetectScrollbar("[Class:Notepad]") Then MsgBox(0, "", "The specified window has a scrollbar")


Func _WinDetectScrollbar($sTitle, $sText = "")
    Local $iCount, $iInstance, $hControl
    Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO)

    Local $sClassList = WinGetClassList($sTitle, $sText)
    If $sClassList = "" Then Return 0

    Local $aClasses = StringRegExp($sClassList, "(?m)(^\N+$)(?!(?:\R(?1))*\R\1)", 3)

    For $i = 0 To UBound($aClasses) - 1
        StringRegExpReplace($sClassList, "\Q" & $aClasses[$i] & "\E\R", "")
        $iCount = @extended

        For $iInstance = 1 To $iCount
            $hControl = ControlGetHandle($sTitle, $sText, "[CLASS:" & $aClasses[$i] & "; INSTANCE:" & $iInstance& "]")

            DllStructSetData($tSCROLLINFO, "cbSize", DllStructGetSize($tSCROLLINFO))
            DllStructSetData($tSCROLLINFO, "fMask", $SIF_ALL)
            _GUIScrollBars_GetScrollInfo($hControl, $SB_HORZ, $tSCROLLINFO)
            If DllStructGetData($tSCROLLINFO, "nMax") >= DllStructGetData($tSCROLLINFO, "nPage") Then Return 1

            _GUIScrollBars_GetScrollInfo($hControl, $SB_VERT, $tSCROLLINFO)
            If DllStructGetData($tSCROLLINFO, "nMax") >= DllStructGetData($tSCROLLINFO, "nPage") Then Return 1
        Next
    Next
    Return 0
EndFunc

 

works for notepad but not for Internet explorer 11 why?

Share this post


Link to post
Share on other sites

So simply stick to the same topic, and explain your issue.
Also stop cross posting  the question in multiple threads, as I see you also posted in an existing thread.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

$oIE.document.body.scrollHeight  and $oIE.document.body.scrollWidth will give you the size of the displayed Web page.  If it is larger than the "normal non-scroll page size", then you know there is a scroll bar.  To get the normal non-scroll page size, go to a small page (like google.ca), find both height and width.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...