ホーム › UI.Shell.PropertiesSystem › PifMgr_GetProperties
PifMgr_GetProperties
関数PIFハンドルから指定グループのプロパティを取得する。
シグネチャ
// SHELL32.dll
#include <windows.h>
INT PifMgr_GetProperties(
HANDLE hProps, // optional
LPCSTR pszGroup, // optional
void* lpProps, // optional
INT cbProps,
DWORD flOpt
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hProps | HANDLE | inoptional |
| pszGroup | LPCSTR | inoptional |
| lpProps | void* | outoptional |
| cbProps | INT | in |
| flOpt | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// SHELL32.dll
#include <windows.h>
INT PifMgr_GetProperties(
HANDLE hProps, // optional
LPCSTR pszGroup, // optional
void* lpProps, // optional
INT cbProps,
DWORD flOpt
);[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern int PifMgr_GetProperties(
IntPtr hProps, // HANDLE optional
[MarshalAs(UnmanagedType.LPStr)] string pszGroup, // LPCSTR optional
IntPtr lpProps, // void* optional, out
int cbProps, // INT
uint flOpt // DWORD
);<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Function PifMgr_GetProperties(
hProps As IntPtr, ' HANDLE optional
<MarshalAs(UnmanagedType.LPStr)> pszGroup As String, ' LPCSTR optional
lpProps As IntPtr, ' void* optional, out
cbProps As Integer, ' INT
flOpt As UInteger ' DWORD
) As Integer
End Function' hProps : HANDLE optional
' pszGroup : LPCSTR optional
' lpProps : void* optional, out
' cbProps : INT
' flOpt : DWORD
Declare PtrSafe Function PifMgr_GetProperties Lib "shell32" ( _
ByVal hProps As LongPtr, _
ByVal pszGroup As String, _
ByVal lpProps As LongPtr, _
ByVal cbProps As Long, _
ByVal flOpt As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PifMgr_GetProperties = ctypes.windll.shell32.PifMgr_GetProperties
PifMgr_GetProperties.restype = ctypes.c_int
PifMgr_GetProperties.argtypes = [
wintypes.HANDLE, # hProps : HANDLE optional
wintypes.LPCSTR, # pszGroup : LPCSTR optional
ctypes.POINTER(None), # lpProps : void* optional, out
ctypes.c_int, # cbProps : INT
wintypes.DWORD, # flOpt : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHELL32.dll')
PifMgr_GetProperties = Fiddle::Function.new(
lib['PifMgr_GetProperties'],
[
Fiddle::TYPE_VOIDP, # hProps : HANDLE optional
Fiddle::TYPE_VOIDP, # pszGroup : LPCSTR optional
Fiddle::TYPE_VOIDP, # lpProps : void* optional, out
Fiddle::TYPE_INT, # cbProps : INT
-Fiddle::TYPE_INT, # flOpt : DWORD
],
Fiddle::TYPE_INT)#[link(name = "shell32")]
extern "system" {
fn PifMgr_GetProperties(
hProps: *mut core::ffi::c_void, // HANDLE optional
pszGroup: *const u8, // LPCSTR optional
lpProps: *mut (), // void* optional, out
cbProps: i32, // INT
flOpt: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SHELL32.dll")]
public static extern int PifMgr_GetProperties(IntPtr hProps, [MarshalAs(UnmanagedType.LPStr)] string pszGroup, IntPtr lpProps, int cbProps, uint flOpt);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_PifMgr_GetProperties' -Namespace Win32 -PassThru
# $api::PifMgr_GetProperties(hProps, pszGroup, lpProps, cbProps, flOpt)#uselib "SHELL32.dll"
#func global PifMgr_GetProperties "PifMgr_GetProperties" sptr, sptr, sptr, sptr, sptr
; PifMgr_GetProperties hProps, pszGroup, lpProps, cbProps, flOpt ; 戻り値は stat
; hProps : HANDLE optional -> "sptr"
; pszGroup : LPCSTR optional -> "sptr"
; lpProps : void* optional, out -> "sptr"
; cbProps : INT -> "sptr"
; flOpt : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "SHELL32.dll"
#cfunc global PifMgr_GetProperties "PifMgr_GetProperties" sptr, str, sptr, int, int
; res = PifMgr_GetProperties(hProps, pszGroup, lpProps, cbProps, flOpt)
; hProps : HANDLE optional -> "sptr"
; pszGroup : LPCSTR optional -> "str"
; lpProps : void* optional, out -> "sptr"
; cbProps : INT -> "int"
; flOpt : DWORD -> "int"; INT PifMgr_GetProperties(HANDLE hProps, LPCSTR pszGroup, void* lpProps, INT cbProps, DWORD flOpt)
#uselib "SHELL32.dll"
#cfunc global PifMgr_GetProperties "PifMgr_GetProperties" intptr, str, intptr, int, int
; res = PifMgr_GetProperties(hProps, pszGroup, lpProps, cbProps, flOpt)
; hProps : HANDLE optional -> "intptr"
; pszGroup : LPCSTR optional -> "str"
; lpProps : void* optional, out -> "intptr"
; cbProps : INT -> "int"
; flOpt : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shell32 = windows.NewLazySystemDLL("SHELL32.dll")
procPifMgr_GetProperties = shell32.NewProc("PifMgr_GetProperties")
)
// hProps (HANDLE optional), pszGroup (LPCSTR optional), lpProps (void* optional, out), cbProps (INT), flOpt (DWORD)
r1, _, err := procPifMgr_GetProperties.Call(
uintptr(hProps),
uintptr(unsafe.Pointer(windows.BytePtrFromString(pszGroup))),
uintptr(lpProps),
uintptr(cbProps),
uintptr(flOpt),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction PifMgr_GetProperties(
hProps: THandle; // HANDLE optional
pszGroup: PAnsiChar; // LPCSTR optional
lpProps: Pointer; // void* optional, out
cbProps: Integer; // INT
flOpt: DWORD // DWORD
): Integer; stdcall;
external 'SHELL32.dll' name 'PifMgr_GetProperties';result := DllCall("SHELL32\PifMgr_GetProperties"
, "Ptr", hProps ; HANDLE optional
, "AStr", pszGroup ; LPCSTR optional
, "Ptr", lpProps ; void* optional, out
, "Int", cbProps ; INT
, "UInt", flOpt ; DWORD
, "Int") ; return: INT●PifMgr_GetProperties(hProps, pszGroup, lpProps, cbProps, flOpt) = DLL("SHELL32.dll", "int PifMgr_GetProperties(void*, char*, void*, int, dword)")
# 呼び出し: PifMgr_GetProperties(hProps, pszGroup, lpProps, cbProps, flOpt)
# hProps : HANDLE optional -> "void*"
# pszGroup : LPCSTR optional -> "char*"
# lpProps : void* optional, out -> "void*"
# cbProps : INT -> "int"
# flOpt : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。