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

SCommentRestriction

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

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

フィールド

フィールドサイズx64x86説明
cValuesDWORD4+0+0lpPropが指すプロパティ値配列の要素数。
lpResSRestriction*8/4+8+4コメントを付与する対象の制限(SRestriction)へのポインタ。NULL可。
lpPropSPropValue*8/4+16+8制限に関連付ける注釈用プロパティ値の配列へのポインタ。

各言語での定義

#include <windows.h>

// SCommentRestriction  (x64 24 / x86 12 バイト)
typedef struct SCommentRestriction {
    DWORD cValues;
    SRestriction* lpRes;
    SPropValue* lpProp;
} SCommentRestriction;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCommentRestriction
{
    public uint cValues;
    public IntPtr lpRes;
    public IntPtr lpProp;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCommentRestriction
    Public cValues As UInteger
    Public lpRes As IntPtr
    Public lpProp As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class SCommentRestriction(ctypes.Structure):
    _fields_ = [
        ("cValues", wintypes.DWORD),
        ("lpRes", ctypes.c_void_p),
        ("lpProp", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct SCommentRestriction {
    pub cValues: u32,
    pub lpRes: *mut core::ffi::c_void,
    pub lpProp: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type SCommentRestriction struct {
	cValues uint32
	lpRes uintptr
	lpProp uintptr
}
type
  SCommentRestriction = record
    cValues: DWORD;
    lpRes: Pointer;
    lpProp: Pointer;
  end;
const SCommentRestriction = extern struct {
    cValues: u32,
    lpRes: ?*anyopaque,
    lpProp: ?*anyopaque,
};
type
  SCommentRestriction {.bycopy.} = object
    cValues: uint32
    lpRes: pointer
    lpProp: pointer
struct SCommentRestriction
{
    uint cValues;
    void* lpRes;
    void* lpProp;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SCommentRestriction サイズ: 12 バイト(x86)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; cValues : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpRes : SRestriction* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; lpProp : SPropValue* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCommentRestriction サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cValues : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpRes : SRestriction* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; lpProp : SPropValue* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SCommentRestriction
    #field int cValues
    #field intptr lpRes
    #field intptr lpProp
#endstruct

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