ホーム › UI.WindowsAndMessaging › SCROLLINFO
SCROLLINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定します。呼び出し元は、このメンバーに sizeof(SCROLLINFO) を設定しなければなりません。 | ||||||||||||||
| fMask | SCROLLINFO_MASK | 4 | +4 | +4 | 設定または取得するスクロールバーのパラメーターを指定します。このメンバーには、次の値の組み合わせを指定できます。
| ||||||||||||||
| nMin | INT | 4 | +8 | +8 | スクロール位置の最小値を指定します。 | ||||||||||||||
| nMax | INT | 4 | +12 | +12 | スクロール位置の最大値を指定します。 | ||||||||||||||
| nPage | DWORD | 4 | +16 | +16 | ページサイズをデバイス単位で指定します。スクロールバーは、この値を使用して比例スクロールボックスの適切なサイズを決定します。 | ||||||||||||||
| nPos | INT | 4 | +20 | +20 | スクロールボックスの位置を指定します。 | ||||||||||||||
| nTrackPos | INT | 4 | +24 | +24 | ユーザーがドラッグしているスクロールボックスの現在位置を指定します。アプリケーションは、SB_THUMBTRACK 要求コードの処理中にこの値を取得できます。アプリケーションが即時のスクロール位置を設定することはできません。SetScrollInfo 関数はこのメンバーを無視します。 |
公式ドキュメント
SCROLLINFO 構造体には、SetScrollInfo 関数 (または SBM_SETSCROLLINFO メッセージ) で設定する、あるいは GetScrollInfo 関数 (または SBM_GETSCROLLINFO メッセージ) で取得するスクロールバーのパラメーターが格納されます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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 Structureimport 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: int32struct 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