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

SV2CVW2_PARAMS

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のバイトサイズ。
psvPrevIShellView*8/4+8+4切り替え前のシェルビュー(IShellView)。遷移元。NULL可。
pfsFOLDERSETTINGS*8/4+16+8適用するフォルダ表示設定(FOLDERSETTINGS)へのポインタ。
psbOwnerIShellBrowser*8/4+24+12ビューを所有するシェルブラウザ(IShellBrowser)。
prcViewRECT*8/4+32+16ビューを配置する矩形(RECT)へのポインタ。
pvidGUID*8/4+40+20使用するビューモードを示すGUIDへのポインタ。
hwndViewHWND8/4+48+24作成されたビューウィンドウのハンドル(出力)。

各言語での定義

#include <windows.h>

// SV2CVW2_PARAMS  (x64 56 / x86 28 バイト)
typedef struct SV2CVW2_PARAMS {
    DWORD cbSize;
    IShellView* psvPrev;
    FOLDERSETTINGS* pfs;
    IShellBrowser* psbOwner;
    RECT* prcView;
    GUID* pvid;
    HWND hwndView;
} SV2CVW2_PARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SV2CVW2_PARAMS
{
    public uint cbSize;
    public IntPtr psvPrev;
    public IntPtr pfs;
    public IntPtr psbOwner;
    public IntPtr prcView;
    public IntPtr pvid;
    public IntPtr hwndView;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SV2CVW2_PARAMS
    Public cbSize As UInteger
    Public psvPrev As IntPtr
    Public pfs As IntPtr
    Public psbOwner As IntPtr
    Public prcView As IntPtr
    Public pvid As IntPtr
    Public hwndView As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class SV2CVW2_PARAMS(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("psvPrev", ctypes.c_void_p),
        ("pfs", ctypes.c_void_p),
        ("psbOwner", ctypes.c_void_p),
        ("prcView", ctypes.c_void_p),
        ("pvid", ctypes.c_void_p),
        ("hwndView", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct SV2CVW2_PARAMS {
    pub cbSize: u32,
    pub psvPrev: *mut core::ffi::c_void,
    pub pfs: *mut core::ffi::c_void,
    pub psbOwner: *mut core::ffi::c_void,
    pub prcView: *mut core::ffi::c_void,
    pub pvid: *mut core::ffi::c_void,
    pub hwndView: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type SV2CVW2_PARAMS struct {
	cbSize uint32
	psvPrev uintptr
	pfs uintptr
	psbOwner uintptr
	prcView uintptr
	pvid uintptr
	hwndView uintptr
}
type
  SV2CVW2_PARAMS = record
    cbSize: DWORD;
    psvPrev: Pointer;
    pfs: Pointer;
    psbOwner: Pointer;
    prcView: Pointer;
    pvid: Pointer;
    hwndView: Pointer;
  end;
const SV2CVW2_PARAMS = extern struct {
    cbSize: u32,
    psvPrev: ?*anyopaque,
    pfs: ?*anyopaque,
    psbOwner: ?*anyopaque,
    prcView: ?*anyopaque,
    pvid: ?*anyopaque,
    hwndView: ?*anyopaque,
};
type
  SV2CVW2_PARAMS {.bycopy.} = object
    cbSize: uint32
    psvPrev: pointer
    pfs: pointer
    psbOwner: pointer
    prcView: pointer
    pvid: pointer
    hwndView: pointer
struct SV2CVW2_PARAMS
{
    uint cbSize;
    void* psvPrev;
    void* pfs;
    void* psbOwner;
    void* prcView;
    void* pvid;
    void* hwndView;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SV2CVW2_PARAMS サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; psvPrev : IShellView* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pfs : FOLDERSETTINGS* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; psbOwner : IShellBrowser* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; prcView : RECT* (+16, 4byte)  varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; pvid : GUID* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; hwndView : HWND (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SV2CVW2_PARAMS サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; psvPrev : IShellView* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pfs : FOLDERSETTINGS* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; psbOwner : IShellBrowser* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; prcView : RECT* (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; pvid : GUID* (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; hwndView : HWND (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SV2CVW2_PARAMS
    #field int cbSize
    #field intptr psvPrev
    #field intptr pfs
    #field intptr psbOwner
    #field intptr prcView
    #field intptr pvid
    #field intptr hwndView
#endstruct

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