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

SHCreatePropSheetExtArray

関数
レジストリからプロパティシート拡張配列を生成する。
DLLSHELL32.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

// SHELL32.dll
#include <windows.h>

HPSXA SHCreatePropSheetExtArray(
    HKEY hKey,
    LPCWSTR pszSubKey,   // optional
    DWORD max_iface
);

パラメーター

名前方向
hKeyHKEYin
pszSubKeyLPCWSTRinoptional
max_ifaceDWORDin

戻り値の型: HPSXA

各言語での呼び出し定義

// SHELL32.dll
#include <windows.h>

HPSXA SHCreatePropSheetExtArray(
    HKEY hKey,
    LPCWSTR pszSubKey,   // optional
    DWORD max_iface
);
[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern IntPtr SHCreatePropSheetExtArray(
    IntPtr hKey,   // HKEY
    [MarshalAs(UnmanagedType.LPWStr)] string pszSubKey,   // LPCWSTR optional
    uint max_iface   // DWORD
);
<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Function SHCreatePropSheetExtArray(
    hKey As IntPtr,   ' HKEY
    <MarshalAs(UnmanagedType.LPWStr)> pszSubKey As String,   ' LPCWSTR optional
    max_iface As UInteger   ' DWORD
) As IntPtr
End Function
' hKey : HKEY
' pszSubKey : LPCWSTR optional
' max_iface : DWORD
Declare PtrSafe Function SHCreatePropSheetExtArray Lib "shell32" ( _
    ByVal hKey As LongPtr, _
    ByVal pszSubKey As LongPtr, _
    ByVal max_iface As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SHCreatePropSheetExtArray = ctypes.windll.shell32.SHCreatePropSheetExtArray
SHCreatePropSheetExtArray.restype = ctypes.c_void_p
SHCreatePropSheetExtArray.argtypes = [
    wintypes.HANDLE,  # hKey : HKEY
    wintypes.LPCWSTR,  # pszSubKey : LPCWSTR optional
    wintypes.DWORD,  # max_iface : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SHELL32.dll')
SHCreatePropSheetExtArray = Fiddle::Function.new(
  lib['SHCreatePropSheetExtArray'],
  [
    Fiddle::TYPE_VOIDP,  # hKey : HKEY
    Fiddle::TYPE_VOIDP,  # pszSubKey : LPCWSTR optional
    -Fiddle::TYPE_INT,  # max_iface : DWORD
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "shell32")]
extern "system" {
    fn SHCreatePropSheetExtArray(
        hKey: *mut core::ffi::c_void,  // HKEY
        pszSubKey: *const u16,  // LPCWSTR optional
        max_iface: u32  // DWORD
    ) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SHELL32.dll")]
public static extern IntPtr SHCreatePropSheetExtArray(IntPtr hKey, [MarshalAs(UnmanagedType.LPWStr)] string pszSubKey, uint max_iface);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_SHCreatePropSheetExtArray' -Namespace Win32 -PassThru
# $api::SHCreatePropSheetExtArray(hKey, pszSubKey, max_iface)
#uselib "SHELL32.dll"
#func global SHCreatePropSheetExtArray "SHCreatePropSheetExtArray" sptr, sptr, sptr
; SHCreatePropSheetExtArray hKey, pszSubKey, max_iface   ; 戻り値は stat
; hKey : HKEY -> "sptr"
; pszSubKey : LPCWSTR optional -> "sptr"
; max_iface : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SHELL32.dll"
#cfunc global SHCreatePropSheetExtArray "SHCreatePropSheetExtArray" sptr, wstr, int
; res = SHCreatePropSheetExtArray(hKey, pszSubKey, max_iface)
; hKey : HKEY -> "sptr"
; pszSubKey : LPCWSTR optional -> "wstr"
; max_iface : DWORD -> "int"
; HPSXA SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, DWORD max_iface)
#uselib "SHELL32.dll"
#cfunc global SHCreatePropSheetExtArray "SHCreatePropSheetExtArray" intptr, wstr, int
; res = SHCreatePropSheetExtArray(hKey, pszSubKey, max_iface)
; hKey : HKEY -> "intptr"
; pszSubKey : LPCWSTR optional -> "wstr"
; max_iface : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	shell32 = windows.NewLazySystemDLL("SHELL32.dll")
	procSHCreatePropSheetExtArray = shell32.NewProc("SHCreatePropSheetExtArray")
)

// hKey (HKEY), pszSubKey (LPCWSTR optional), max_iface (DWORD)
r1, _, err := procSHCreatePropSheetExtArray.Call(
	uintptr(hKey),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszSubKey))),
	uintptr(max_iface),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HPSXA
function SHCreatePropSheetExtArray(
  hKey: THandle;   // HKEY
  pszSubKey: PWideChar;   // LPCWSTR optional
  max_iface: DWORD   // DWORD
): THandle; stdcall;
  external 'SHELL32.dll' name 'SHCreatePropSheetExtArray';
result := DllCall("SHELL32\SHCreatePropSheetExtArray"
    , "Ptr", hKey   ; HKEY
    , "WStr", pszSubKey   ; LPCWSTR optional
    , "UInt", max_iface   ; DWORD
    , "Ptr")   ; return: HPSXA
●SHCreatePropSheetExtArray(hKey, pszSubKey, max_iface) = DLL("SHELL32.dll", "void* SHCreatePropSheetExtArray(void*, char*, dword)")
# 呼び出し: SHCreatePropSheetExtArray(hKey, pszSubKey, max_iface)
# hKey : HKEY -> "void*"
# pszSubKey : LPCWSTR optional -> "char*"
# max_iface : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。