Win32 API 日本語リファレンス
ホームUI.Accessibility › ScrollItemPattern_ScrollIntoView

ScrollItemPattern_ScrollIntoView

関数
ScrollItemパターンで要素を表示領域内へスクロールする。
DLLUIAutomationCore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

// UIAutomationCore.dll
#include <windows.h>

HRESULT ScrollItemPattern_ScrollIntoView(
    HUIAPATTERNOBJECT hobj
);

パラメーター

名前方向
hobjHUIAPATTERNOBJECTin

戻り値の型: HRESULT

各言語での呼び出し定義

// UIAutomationCore.dll
#include <windows.h>

HRESULT ScrollItemPattern_ScrollIntoView(
    HUIAPATTERNOBJECT hobj
);
[DllImport("UIAutomationCore.dll", ExactSpelling = true)]
static extern int ScrollItemPattern_ScrollIntoView(
    IntPtr hobj   // HUIAPATTERNOBJECT
);
<DllImport("UIAutomationCore.dll", ExactSpelling:=True)>
Public Shared Function ScrollItemPattern_ScrollIntoView(
    hobj As IntPtr   ' HUIAPATTERNOBJECT
) As Integer
End Function
' hobj : HUIAPATTERNOBJECT
Declare PtrSafe Function ScrollItemPattern_ScrollIntoView Lib "uiautomationcore" ( _
    ByVal hobj As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ScrollItemPattern_ScrollIntoView = ctypes.windll.uiautomationcore.ScrollItemPattern_ScrollIntoView
ScrollItemPattern_ScrollIntoView.restype = ctypes.c_int
ScrollItemPattern_ScrollIntoView.argtypes = [
    wintypes.HANDLE,  # hobj : HUIAPATTERNOBJECT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('UIAutomationCore.dll')
ScrollItemPattern_ScrollIntoView = Fiddle::Function.new(
  lib['ScrollItemPattern_ScrollIntoView'],
  [
    Fiddle::TYPE_VOIDP,  # hobj : HUIAPATTERNOBJECT
  ],
  Fiddle::TYPE_INT)
#[link(name = "uiautomationcore")]
extern "system" {
    fn ScrollItemPattern_ScrollIntoView(
        hobj: *mut core::ffi::c_void  // HUIAPATTERNOBJECT
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("UIAutomationCore.dll")]
public static extern int ScrollItemPattern_ScrollIntoView(IntPtr hobj);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UIAutomationCore_ScrollItemPattern_ScrollIntoView' -Namespace Win32 -PassThru
# $api::ScrollItemPattern_ScrollIntoView(hobj)
#uselib "UIAutomationCore.dll"
#func global ScrollItemPattern_ScrollIntoView "ScrollItemPattern_ScrollIntoView" sptr
; ScrollItemPattern_ScrollIntoView hobj   ; 戻り値は stat
; hobj : HUIAPATTERNOBJECT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "UIAutomationCore.dll"
#cfunc global ScrollItemPattern_ScrollIntoView "ScrollItemPattern_ScrollIntoView" sptr
; res = ScrollItemPattern_ScrollIntoView(hobj)
; hobj : HUIAPATTERNOBJECT -> "sptr"
; HRESULT ScrollItemPattern_ScrollIntoView(HUIAPATTERNOBJECT hobj)
#uselib "UIAutomationCore.dll"
#cfunc global ScrollItemPattern_ScrollIntoView "ScrollItemPattern_ScrollIntoView" intptr
; res = ScrollItemPattern_ScrollIntoView(hobj)
; hobj : HUIAPATTERNOBJECT -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	uiautomationcore = windows.NewLazySystemDLL("UIAutomationCore.dll")
	procScrollItemPattern_ScrollIntoView = uiautomationcore.NewProc("ScrollItemPattern_ScrollIntoView")
)

// hobj (HUIAPATTERNOBJECT)
r1, _, err := procScrollItemPattern_ScrollIntoView.Call(
	uintptr(hobj),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function ScrollItemPattern_ScrollIntoView(
  hobj: THandle   // HUIAPATTERNOBJECT
): Integer; stdcall;
  external 'UIAutomationCore.dll' name 'ScrollItemPattern_ScrollIntoView';
result := DllCall("UIAutomationCore\ScrollItemPattern_ScrollIntoView"
    , "Ptr", hobj   ; HUIAPATTERNOBJECT
    , "Int")   ; return: HRESULT
●ScrollItemPattern_ScrollIntoView(hobj) = DLL("UIAutomationCore.dll", "int ScrollItemPattern_ScrollIntoView(void*)")
# 呼び出し: ScrollItemPattern_ScrollIntoView(hobj)
# hobj : HUIAPATTERNOBJECT -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。