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

SCROLLINFO

構造体
サイズx64: 28 バイト / x86: 28 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト数)である。
fMaskSCROLLINFO_MASK4+4+4取得または設定するパラメータを示すマスクである(SIF_RANGE など)。
nMinINT4+8+8スクロール範囲の最小値である。
nMaxINT4+12+12スクロール範囲の最大値である。
nPageDWORD4+16+16ページサイズである。プロポーショナルスクロールバーのつまみのサイズ算出に使われる。
nPosINT4+20+20スクロールボックスの現在位置である。
nTrackPosINT4+24+24ドラッグ中のスクロールボックスの現在の追跡位置である。取得時のみ有効である。

各言語での定義

#include <windows.h>

// SCROLLINFO  (x64 28 / x86 28 バイト)
typedef struct SCROLLINFO {
    DWORD cbSize;
    SCROLLINFO_MASK fMask;
    INT nMin;
    INT nMax;
    DWORD nPage;
    INT nPos;
    INT nTrackPos;
} SCROLLINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCROLLINFO
{
    public uint cbSize;
    public uint fMask;
    public int nMin;
    public int nMax;
    public uint nPage;
    public int nPos;
    public int nTrackPos;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCROLLINFO
    Public cbSize As UInteger
    Public fMask As UInteger
    Public nMin As Integer
    Public nMax As Integer
    Public nPage As UInteger
    Public nPos As Integer
    Public nTrackPos As Integer
End Structure
import ctypes
from ctypes import wintypes

class SCROLLINFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("fMask", wintypes.DWORD),
        ("nMin", ctypes.c_int),
        ("nMax", ctypes.c_int),
        ("nPage", wintypes.DWORD),
        ("nPos", ctypes.c_int),
        ("nTrackPos", ctypes.c_int),
    ]
#[repr(C)]
pub struct SCROLLINFO {
    pub cbSize: u32,
    pub fMask: u32,
    pub nMin: i32,
    pub nMax: i32,
    pub nPage: u32,
    pub nPos: i32,
    pub nTrackPos: i32,
}
import "golang.org/x/sys/windows"

type SCROLLINFO struct {
	cbSize uint32
	fMask uint32
	nMin int32
	nMax int32
	nPage uint32
	nPos int32
	nTrackPos int32
}
type
  SCROLLINFO = record
    cbSize: DWORD;
    fMask: DWORD;
    nMin: Integer;
    nMax: Integer;
    nPage: DWORD;
    nPos: Integer;
    nTrackPos: Integer;
  end;
const SCROLLINFO = extern struct {
    cbSize: u32,
    fMask: u32,
    nMin: i32,
    nMax: i32,
    nPage: u32,
    nPos: i32,
    nTrackPos: i32,
};
type
  SCROLLINFO {.bycopy.} = object
    cbSize: uint32
    fMask: uint32
    nMin: int32
    nMax: int32
    nPage: uint32
    nPos: int32
    nTrackPos: int32
struct SCROLLINFO
{
    uint cbSize;
    uint fMask;
    int nMin;
    int nMax;
    uint nPage;
    int nPos;
    int nTrackPos;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCROLLINFO サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; fMask : SCROLLINFO_MASK (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; nMin : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; nMax : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; nPage : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; nPos : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; nTrackPos : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SCROLLINFO
    #field int cbSize
    #field int fMask
    #field int nMin
    #field int nMax
    #field int nPage
    #field int nPos
    #field int nTrackPos
#endstruct

stdim st, SCROLLINFO        ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize