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

NAMED_PROFILE_INFO

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

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

フィールド

フィールドサイズx64x86説明
dwFlagsDWORD4+0+0名前付きプロファイルの属性を示すフラグ群。
dwCountDWORD4+4+4名前付きカラーの総数。
dwCountDevCoordinatesDWORD4+8+8デバイス座標のチャネル数。
szPrefixCHAR32+12+12カラー名に付与する接頭辞文字列バッファ。
szSuffixCHAR32+44+44カラー名に付与する接尾辞文字列バッファ。

各言語での定義

#include <windows.h>

// NAMED_PROFILE_INFO  (x64 76 / x86 76 バイト)
typedef struct NAMED_PROFILE_INFO {
    DWORD dwFlags;
    DWORD dwCount;
    DWORD dwCountDevCoordinates;
    CHAR szPrefix[32];
    CHAR szSuffix[32];
} NAMED_PROFILE_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NAMED_PROFILE_INFO
{
    public uint dwFlags;
    public uint dwCount;
    public uint dwCountDevCoordinates;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public sbyte[] szPrefix;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public sbyte[] szSuffix;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NAMED_PROFILE_INFO
    Public dwFlags As UInteger
    Public dwCount As UInteger
    Public dwCountDevCoordinates As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public szPrefix() As SByte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public szSuffix() As SByte
End Structure
import ctypes
from ctypes import wintypes

class NAMED_PROFILE_INFO(ctypes.Structure):
    _fields_ = [
        ("dwFlags", wintypes.DWORD),
        ("dwCount", wintypes.DWORD),
        ("dwCountDevCoordinates", wintypes.DWORD),
        ("szPrefix", ctypes.c_byte * 32),
        ("szSuffix", ctypes.c_byte * 32),
    ]
#[repr(C)]
pub struct NAMED_PROFILE_INFO {
    pub dwFlags: u32,
    pub dwCount: u32,
    pub dwCountDevCoordinates: u32,
    pub szPrefix: [i8; 32],
    pub szSuffix: [i8; 32],
}
import "golang.org/x/sys/windows"

type NAMED_PROFILE_INFO struct {
	dwFlags uint32
	dwCount uint32
	dwCountDevCoordinates uint32
	szPrefix [32]int8
	szSuffix [32]int8
}
type
  NAMED_PROFILE_INFO = record
    dwFlags: DWORD;
    dwCount: DWORD;
    dwCountDevCoordinates: DWORD;
    szPrefix: array[0..31] of Shortint;
    szSuffix: array[0..31] of Shortint;
  end;
const NAMED_PROFILE_INFO = extern struct {
    dwFlags: u32,
    dwCount: u32,
    dwCountDevCoordinates: u32,
    szPrefix: [32]i8,
    szSuffix: [32]i8,
};
type
  NAMED_PROFILE_INFO {.bycopy.} = object
    dwFlags: uint32
    dwCount: uint32
    dwCountDevCoordinates: uint32
    szPrefix: array[32, int8]
    szSuffix: array[32, int8]
struct NAMED_PROFILE_INFO
{
    uint dwFlags;
    uint dwCount;
    uint dwCountDevCoordinates;
    byte[32] szPrefix;
    byte[32] szSuffix;
}

HSP用 定義

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

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

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