SHCOLUMNINIT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwFlags | DWORD | 4 | +0 | +0 | 初期化動作を制御するフラグ。現状は予約で0。 |
| dwReserved | DWORD | 4 | +4 | +4 | 予約領域。0を設定する。 |
| wszFolder | WCHAR | 520 | +8 | +8 | 対象フォルダーのフルパスを格納する WCHAR 配列。 |
各言語での定義
#include <windows.h>
// SHCOLUMNINIT (x64 528 / x86 528 バイト)
typedef struct SHCOLUMNINIT {
DWORD dwFlags;
DWORD dwReserved;
WCHAR wszFolder[260];
} SHCOLUMNINIT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SHCOLUMNINIT
{
public uint dwFlags;
public uint dwReserved;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string wszFolder;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SHCOLUMNINIT
Public dwFlags As UInteger
Public dwReserved As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public wszFolder As String
End Structureimport ctypes
from ctypes import wintypes
class SHCOLUMNINIT(ctypes.Structure):
_fields_ = [
("dwFlags", wintypes.DWORD),
("dwReserved", wintypes.DWORD),
("wszFolder", ctypes.c_wchar * 260),
]#[repr(C)]
pub struct SHCOLUMNINIT {
pub dwFlags: u32,
pub dwReserved: u32,
pub wszFolder: [u16; 260],
}import "golang.org/x/sys/windows"
type SHCOLUMNINIT struct {
dwFlags uint32
dwReserved uint32
wszFolder [260]uint16
}type
SHCOLUMNINIT = record
dwFlags: DWORD;
dwReserved: DWORD;
wszFolder: array[0..259] of WideChar;
end;const SHCOLUMNINIT = extern struct {
dwFlags: u32,
dwReserved: u32,
wszFolder: [260]u16,
};type
SHCOLUMNINIT {.bycopy.} = object
dwFlags: uint32
dwReserved: uint32
wszFolder: array[260, uint16]struct SHCOLUMNINIT
{
uint dwFlags;
uint dwReserved;
wchar[260] wszFolder;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SHCOLUMNINIT サイズ: 528 バイト(x64)
dim st, 132 ; 4byte整数×132(構造体サイズ 528 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwReserved : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; wszFolder : WCHAR (+8, 520byte) varptr(st)+8 を基点に操作(520byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SHCOLUMNINIT
#field int dwFlags
#field int dwReserved
#field wchar wszFolder 260
#endstruct
stdim st, SHCOLUMNINIT ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags