Win32 API 日本語リファレンス
ホームUI.Shell.Common › SHELLDETAILS

SHELLDETAILS

構造体
サイズx64: 280 バイト / x86: 272 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
fmtINT4+0+0列の表示書式(左寄せ・右寄せ等のLVCFMT定数)。
cxCharINT4+4+4列幅(平均文字数単位)。
strSTRRET272/264+8+8列の内容またはヘッダ文字列(STRRET)。

各言語での定義

#include <windows.h>

// STRRET  (x64 272 / x86 264 バイト)
typedef struct STRRET {
    DWORD uType;
    _Anonymous_e__Union Anonymous;
} STRRET;

// SHELLDETAILS  (x64 280 / x86 272 バイト)
#pragma pack(push, 1)
typedef struct SHELLDETAILS {
    INT fmt;
    INT cxChar;
    STRRET str;
} SHELLDETAILS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct STRRET
{
    public uint uType;
    public _Anonymous_e__Union Anonymous;
}

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct SHELLDETAILS
{
    public int fmt;
    public int cxChar;
    public STRRET str;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure STRRET
    Public uType As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure SHELLDETAILS
    Public fmt As Integer
    Public cxChar As Integer
    Public str As STRRET
End Structure
import ctypes
from ctypes import wintypes

class STRRET(ctypes.Structure):
    _fields_ = [
        ("uType", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]

class SHELLDETAILS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("fmt", ctypes.c_int),
        ("cxChar", ctypes.c_int),
        ("str", STRRET),
    ]
#[repr(C)]
pub struct STRRET {
    pub uType: u32,
    pub Anonymous: _Anonymous_e__Union,
}

#[repr(C, packed(1))]
pub struct SHELLDETAILS {
    pub fmt: i32,
    pub cxChar: i32,
    pub str: STRRET,
}
import "golang.org/x/sys/windows"

type STRRET struct {
	uType uint32
	Anonymous _Anonymous_e__Union
}

type SHELLDETAILS struct {
	fmt int32
	cxChar int32
	str STRRET
}
type
  STRRET = record
    uType: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  SHELLDETAILS = packed record
    fmt: Integer;
    cxChar: Integer;
    str: STRRET;
  end;
const STRRET = extern struct {
    uType: u32,
    Anonymous: _Anonymous_e__Union,
};

const SHELLDETAILS = extern struct {
    fmt: i32,
    cxChar: i32,
    str: STRRET,
};
type
  STRRET {.bycopy.} = object
    uType: uint32
    Anonymous: _Anonymous_e__Union

  SHELLDETAILS {.packed.} = object
    fmt: int32
    cxChar: int32
    str: STRRET
struct STRRET
{
    uint uType;
    _Anonymous_e__Union Anonymous;
}

align(1)
struct SHELLDETAILS
{
    int fmt;
    int cxChar;
    STRRET str;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SHELLDETAILS サイズ: 272 バイト(x86)
dim st, 68    ; 4byte整数×68(構造体サイズ 272 / 4 切り上げ)
; fmt : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cxChar : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; str : STRRET (+8, 264byte)  varptr(st)+8 を基点に操作(264byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SHELLDETAILS サイズ: 280 バイト(x64)
dim st, 70    ; 4byte整数×70(構造体サイズ 280 / 4 切り上げ)
; fmt : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cxChar : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; str : STRRET (+8, 272byte)  varptr(st)+8 を基点に操作(272byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global STRRET
    #field int uType
    #field byte Anonymous 264
#endstruct

#defstruct global SHELLDETAILS, pack=1
    #field int fmt
    #field int cxChar
    #field STRRET str
#endstruct

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