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

DETAILSINFO

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

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

フィールド

フィールドサイズx64x86説明
pidlITEMIDLIST*8/4+0+0詳細表示の対象となるアイテムのPIDLへのポインタ。
fmtINT4+8+4列の書式(左寄せ・右寄せ等)を示す LVCFMT_ 系の値。
cxCharINT4+12+8列の幅を平均文字数で表した値。
strSTRRET272/264+16+12取得した詳細文字列を格納する STRRET 構造体。
iImageINT4+288+276アイテムに関連付けられたイメージリストのインデックス。

各言語での定義

#include <windows.h>

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

// DETAILSINFO  (x64 296 / x86 280 バイト)
typedef struct DETAILSINFO {
    ITEMIDLIST* pidl;
    INT fmt;
    INT cxChar;
    STRRET str;
    INT iImage;
} DETAILSINFO;
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, CharSet = CharSet.Unicode)]
public struct DETAILSINFO
{
    public IntPtr pidl;
    public int fmt;
    public int cxChar;
    public STRRET str;
    public int iImage;
}
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, CharSet:=CharSet.Unicode)>
Public Structure DETAILSINFO
    Public pidl As IntPtr
    Public fmt As Integer
    Public cxChar As Integer
    Public str As STRRET
    Public iImage As Integer
End Structure
import ctypes
from ctypes import wintypes

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

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

#[repr(C)]
pub struct DETAILSINFO {
    pub pidl: *mut core::ffi::c_void,
    pub fmt: i32,
    pub cxChar: i32,
    pub str: STRRET,
    pub iImage: i32,
}
import "golang.org/x/sys/windows"

type STRRET struct {
	uType uint32
	Anonymous _Anonymous_e__Union
}

type DETAILSINFO struct {
	pidl uintptr
	fmt int32
	cxChar int32
	str STRRET
	iImage int32
}
type
  STRRET = record
    uType: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;

  DETAILSINFO = record
    pidl: Pointer;
    fmt: Integer;
    cxChar: Integer;
    str: STRRET;
    iImage: Integer;
  end;
const STRRET = extern struct {
    uType: u32,
    Anonymous: _Anonymous_e__Union,
};

const DETAILSINFO = extern struct {
    pidl: ?*anyopaque,
    fmt: i32,
    cxChar: i32,
    str: STRRET,
    iImage: i32,
};
type
  STRRET {.bycopy.} = object
    uType: uint32
    Anonymous: _Anonymous_e__Union

  DETAILSINFO {.bycopy.} = object
    pidl: pointer
    fmt: int32
    cxChar: int32
    str: STRRET
    iImage: int32
struct STRRET
{
    uint uType;
    _Anonymous_e__Union Anonymous;
}

struct DETAILSINFO
{
    void* pidl;
    int fmt;
    int cxChar;
    STRRET str;
    int iImage;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DETAILSINFO サイズ: 280 バイト(x86)
dim st, 70    ; 4byte整数×70(構造体サイズ 280 / 4 切り上げ)
; pidl : ITEMIDLIST* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; fmt : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cxChar : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; str : STRRET (+12, 264byte)  varptr(st)+12 を基点に操作(264byte:入れ子/配列)
; iImage : INT (+276, 4byte)  st.69 = 値  /  値 = st.69   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DETAILSINFO サイズ: 296 バイト(x64)
dim st, 74    ; 4byte整数×74(構造体サイズ 296 / 4 切り上げ)
; pidl : ITEMIDLIST* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; fmt : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cxChar : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; str : STRRET (+16, 272byte)  varptr(st)+16 を基点に操作(272byte:入れ子/配列)
; iImage : INT (+288, 4byte)  st.72 = 値  /  値 = st.72   (lpoke/lpeek も可)
; ※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 DETAILSINFO
    #field intptr pidl
    #field int fmt
    #field int cxChar
    #field STRRET str
    #field int iImage
#endstruct

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