Win32 API 日本語リファレンス
ホームSystem.Ole › OLEUIVIEWPROPSA

OLEUIVIEWPROPSA

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

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

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0この構造体のサイズをバイト単位で表す。
dwFlagsVIEW_OBJECT_PROPERTIES_FLAGS4+4+4表示プロパティページの動作フラグ(VIEW_OBJECT_PROPERTIES_FLAGS)である。
dwReserved1DWORD8+8+8予約フィールドである。0を指定する。
lpfnHookLPFNOLEUIHOOK8/4+16+16ページをカスタマイズするフックプロシージャである。NULL可。
lCustDataLPARAM8/4+24+20フックプロシージャへ渡すアプリ定義データである。
dwReserved2DWORD12+32+24予約フィールドである。0を指定する。
lpOPOLEUIOBJECTPROPSA*8/4+48+36親となるOLEUIOBJECTPROPSA構造体へのポインタである。
nScaleMinINT4+56+40拡大縮小率の最小値(パーセント)である。
nScaleMaxINT4+60+44拡大縮小率の最大値(パーセント)である。

各言語での定義

#include <windows.h>

// OLEUIVIEWPROPSA  (x64 64 / x86 48 バイト)
typedef struct OLEUIVIEWPROPSA {
    DWORD cbStruct;
    VIEW_OBJECT_PROPERTIES_FLAGS dwFlags;
    DWORD dwReserved1[2];
    LPFNOLEUIHOOK lpfnHook;
    LPARAM lCustData;
    DWORD dwReserved2[3];
    OLEUIOBJECTPROPSA* lpOP;
    INT nScaleMin;
    INT nScaleMax;
} OLEUIVIEWPROPSA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OLEUIVIEWPROPSA
{
    public uint cbStruct;
    public uint dwFlags;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public uint[] dwReserved1;
    public IntPtr lpfnHook;
    public IntPtr lCustData;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public uint[] dwReserved2;
    public IntPtr lpOP;
    public int nScaleMin;
    public int nScaleMax;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OLEUIVIEWPROPSA
    Public cbStruct As UInteger
    Public dwFlags As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public dwReserved1() As UInteger
    Public lpfnHook As IntPtr
    Public lCustData As IntPtr
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public dwReserved2() As UInteger
    Public lpOP As IntPtr
    Public nScaleMin As Integer
    Public nScaleMax As Integer
End Structure
import ctypes
from ctypes import wintypes

class OLEUIVIEWPROPSA(ctypes.Structure):
    _fields_ = [
        ("cbStruct", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("dwReserved1", wintypes.DWORD * 2),
        ("lpfnHook", ctypes.c_void_p),
        ("lCustData", ctypes.c_ssize_t),
        ("dwReserved2", wintypes.DWORD * 3),
        ("lpOP", ctypes.c_void_p),
        ("nScaleMin", ctypes.c_int),
        ("nScaleMax", ctypes.c_int),
    ]
#[repr(C)]
pub struct OLEUIVIEWPROPSA {
    pub cbStruct: u32,
    pub dwFlags: u32,
    pub dwReserved1: [u32; 2],
    pub lpfnHook: *mut core::ffi::c_void,
    pub lCustData: isize,
    pub dwReserved2: [u32; 3],
    pub lpOP: *mut core::ffi::c_void,
    pub nScaleMin: i32,
    pub nScaleMax: i32,
}
import "golang.org/x/sys/windows"

type OLEUIVIEWPROPSA struct {
	cbStruct uint32
	dwFlags uint32
	dwReserved1 [2]uint32
	lpfnHook uintptr
	lCustData uintptr
	dwReserved2 [3]uint32
	lpOP uintptr
	nScaleMin int32
	nScaleMax int32
}
type
  OLEUIVIEWPROPSA = record
    cbStruct: DWORD;
    dwFlags: DWORD;
    dwReserved1: array[0..1] of DWORD;
    lpfnHook: Pointer;
    lCustData: NativeInt;
    dwReserved2: array[0..2] of DWORD;
    lpOP: Pointer;
    nScaleMin: Integer;
    nScaleMax: Integer;
  end;
const OLEUIVIEWPROPSA = extern struct {
    cbStruct: u32,
    dwFlags: u32,
    dwReserved1: [2]u32,
    lpfnHook: ?*anyopaque,
    lCustData: isize,
    dwReserved2: [3]u32,
    lpOP: ?*anyopaque,
    nScaleMin: i32,
    nScaleMax: i32,
};
type
  OLEUIVIEWPROPSA {.bycopy.} = object
    cbStruct: uint32
    dwFlags: uint32
    dwReserved1: array[2, uint32]
    lpfnHook: pointer
    lCustData: int
    dwReserved2: array[3, uint32]
    lpOP: pointer
    nScaleMin: int32
    nScaleMax: int32
struct OLEUIVIEWPROPSA
{
    uint cbStruct;
    uint dwFlags;
    uint[2] dwReserved1;
    void* lpfnHook;
    ptrdiff_t lCustData;
    uint[3] dwReserved2;
    void* lpOP;
    int nScaleMin;
    int nScaleMax;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OLEUIVIEWPROPSA サイズ: 48 バイト(x86)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : VIEW_OBJECT_PROPERTIES_FLAGS (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwReserved1 : DWORD (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; lpfnHook : LPFNOLEUIHOOK (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lCustData : LPARAM (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwReserved2 : DWORD (+24, 12byte)  varptr(st)+24 を基点に操作(12byte:入れ子/配列)
; lpOP : OLEUIOBJECTPROPSA* (+36, 4byte)  varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; nScaleMin : INT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; nScaleMax : INT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OLEUIVIEWPROPSA サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : VIEW_OBJECT_PROPERTIES_FLAGS (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwReserved1 : DWORD (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; lpfnHook : LPFNOLEUIHOOK (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lCustData : LPARAM (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwReserved2 : DWORD (+32, 12byte)  varptr(st)+32 を基点に操作(12byte:入れ子/配列)
; lpOP : OLEUIOBJECTPROPSA* (+48, 8byte)  varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; nScaleMin : INT (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; nScaleMax : INT (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global OLEUIVIEWPROPSA
    #field int cbStruct
    #field int dwFlags
    #field int dwReserved1 2
    #field intptr lpfnHook
    #field intptr lCustData
    #field int dwReserved2 3
    #field intptr lpOP
    #field int nScaleMin
    #field int nScaleMax
#endstruct

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