搞定了。贴代码:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <GUIScrollBars.au3>
#include <ScrollBarConstants.au3>
#include <Array.au3>
Run("Notepad")
Sleep(200)
$hWin = WinGetHandle("[CLASS:Notepad]")
For $i = 1 To 40
ControlSend($hWin, "", "Edit1", @CRLF)
Next
$hCtrl = ControlGetHandle("[CLASS:Notepad]", "", "Edit1")
Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO)
DllStructSetData($tSCROLLINFO, "cbSize", DllStructGetSize($tSCROLLINFO))
DllStructSetData($tSCROLLINFO, "fMask", $SIF_RANGE)
$Size = DllStructGetData($tSCROLLINFO, 2)
MsgBox(0,0, $Size)
Func _GetScrollInfo($hWnd, $fnBar, ByRef $tSCROLLINFO)
If Not IsHWnd($hWnd) Then Return SetError(-2, -1, False)
Local $aResult = DllCall("user32.dll", "bool", "GetScrollInfo", "hwnd", $hWnd, "int", $fnBar, "ptr", DllStructGetPtr($tSCROLLINFO))
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0]
EndFunc
|