ホーム › UI.Shell.PropertiesSystem › PSPropertyBag_Delete
PSPropertyBag_Delete
関数プロパティバッグから指定プロパティを削除する。
シグネチャ
// PROPSYS.dll
#include <windows.h>
HRESULT PSPropertyBag_Delete(
IPropertyBag* propBag,
LPCWSTR propName
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| propBag | IPropertyBag* | in |
| propName | LPCWSTR | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// PROPSYS.dll
#include <windows.h>
HRESULT PSPropertyBag_Delete(
IPropertyBag* propBag,
LPCWSTR propName
);[DllImport("PROPSYS.dll", ExactSpelling = true)]
static extern int PSPropertyBag_Delete(
IntPtr propBag, // IPropertyBag*
[MarshalAs(UnmanagedType.LPWStr)] string propName // LPCWSTR
);<DllImport("PROPSYS.dll", ExactSpelling:=True)>
Public Shared Function PSPropertyBag_Delete(
propBag As IntPtr, ' IPropertyBag*
<MarshalAs(UnmanagedType.LPWStr)> propName As String ' LPCWSTR
) As Integer
End Function' propBag : IPropertyBag*
' propName : LPCWSTR
Declare PtrSafe Function PSPropertyBag_Delete Lib "propsys" ( _
ByVal propBag As LongPtr, _
ByVal propName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PSPropertyBag_Delete = ctypes.windll.propsys.PSPropertyBag_Delete
PSPropertyBag_Delete.restype = ctypes.c_int
PSPropertyBag_Delete.argtypes = [
ctypes.c_void_p, # propBag : IPropertyBag*
wintypes.LPCWSTR, # propName : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('PROPSYS.dll')
PSPropertyBag_Delete = Fiddle::Function.new(
lib['PSPropertyBag_Delete'],
[
Fiddle::TYPE_VOIDP, # propBag : IPropertyBag*
Fiddle::TYPE_VOIDP, # propName : LPCWSTR
],
Fiddle::TYPE_INT)#[link(name = "propsys")]
extern "system" {
fn PSPropertyBag_Delete(
propBag: *mut core::ffi::c_void, // IPropertyBag*
propName: *const u16 // LPCWSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("PROPSYS.dll")]
public static extern int PSPropertyBag_Delete(IntPtr propBag, [MarshalAs(UnmanagedType.LPWStr)] string propName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'PROPSYS_PSPropertyBag_Delete' -Namespace Win32 -PassThru
# $api::PSPropertyBag_Delete(propBag, propName)#uselib "PROPSYS.dll"
#func global PSPropertyBag_Delete "PSPropertyBag_Delete" sptr, sptr
; PSPropertyBag_Delete propBag, propName ; 戻り値は stat
; propBag : IPropertyBag* -> "sptr"
; propName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "PROPSYS.dll"
#cfunc global PSPropertyBag_Delete "PSPropertyBag_Delete" sptr, wstr
; res = PSPropertyBag_Delete(propBag, propName)
; propBag : IPropertyBag* -> "sptr"
; propName : LPCWSTR -> "wstr"; HRESULT PSPropertyBag_Delete(IPropertyBag* propBag, LPCWSTR propName)
#uselib "PROPSYS.dll"
#cfunc global PSPropertyBag_Delete "PSPropertyBag_Delete" intptr, wstr
; res = PSPropertyBag_Delete(propBag, propName)
; propBag : IPropertyBag* -> "intptr"
; propName : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
propsys = windows.NewLazySystemDLL("PROPSYS.dll")
procPSPropertyBag_Delete = propsys.NewProc("PSPropertyBag_Delete")
)
// propBag (IPropertyBag*), propName (LPCWSTR)
r1, _, err := procPSPropertyBag_Delete.Call(
uintptr(propBag),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(propName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction PSPropertyBag_Delete(
propBag: Pointer; // IPropertyBag*
propName: PWideChar // LPCWSTR
): Integer; stdcall;
external 'PROPSYS.dll' name 'PSPropertyBag_Delete';result := DllCall("PROPSYS\PSPropertyBag_Delete"
, "Ptr", propBag ; IPropertyBag*
, "WStr", propName ; LPCWSTR
, "Int") ; return: HRESULT●PSPropertyBag_Delete(propBag, propName) = DLL("PROPSYS.dll", "int PSPropertyBag_Delete(void*, char*)")
# 呼び出し: PSPropertyBag_Delete(propBag, propName)
# propBag : IPropertyBag* -> "void*"
# propName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。