ホーム › Devices.Sensors › IsKeyPresentInPropertyList
IsKeyPresentInPropertyList
関数プロパティリストに指定キーが存在するか判定する。
シグネチャ
// SensorsUtilsV2.dll
#include <windows.h>
BOOLEAN IsKeyPresentInPropertyList(
SENSOR_PROPERTY_LIST* pList,
const PROPERTYKEY* pKey
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pList | SENSOR_PROPERTY_LIST* | in |
| pKey | PROPERTYKEY* | in |
戻り値の型: BOOLEAN
各言語での呼び出し定義
// SensorsUtilsV2.dll
#include <windows.h>
BOOLEAN IsKeyPresentInPropertyList(
SENSOR_PROPERTY_LIST* pList,
const PROPERTYKEY* pKey
);[DllImport("SensorsUtilsV2.dll", ExactSpelling = true)]
static extern byte IsKeyPresentInPropertyList(
IntPtr pList, // SENSOR_PROPERTY_LIST*
IntPtr pKey // PROPERTYKEY*
);<DllImport("SensorsUtilsV2.dll", ExactSpelling:=True)>
Public Shared Function IsKeyPresentInPropertyList(
pList As IntPtr, ' SENSOR_PROPERTY_LIST*
pKey As IntPtr ' PROPERTYKEY*
) As Byte
End Function' pList : SENSOR_PROPERTY_LIST*
' pKey : PROPERTYKEY*
Declare PtrSafe Function IsKeyPresentInPropertyList Lib "sensorsutilsv2" ( _
ByVal pList As LongPtr, _
ByVal pKey As LongPtr) As Byte
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
IsKeyPresentInPropertyList = ctypes.windll.sensorsutilsv2.IsKeyPresentInPropertyList
IsKeyPresentInPropertyList.restype = ctypes.c_byte
IsKeyPresentInPropertyList.argtypes = [
ctypes.c_void_p, # pList : SENSOR_PROPERTY_LIST*
ctypes.c_void_p, # pKey : PROPERTYKEY*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SensorsUtilsV2.dll')
IsKeyPresentInPropertyList = Fiddle::Function.new(
lib['IsKeyPresentInPropertyList'],
[
Fiddle::TYPE_VOIDP, # pList : SENSOR_PROPERTY_LIST*
Fiddle::TYPE_VOIDP, # pKey : PROPERTYKEY*
],
Fiddle::TYPE_CHAR)#[link(name = "sensorsutilsv2")]
extern "system" {
fn IsKeyPresentInPropertyList(
pList: *mut SENSOR_PROPERTY_LIST, // SENSOR_PROPERTY_LIST*
pKey: *const PROPERTYKEY // PROPERTYKEY*
) -> u8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SensorsUtilsV2.dll")]
public static extern byte IsKeyPresentInPropertyList(IntPtr pList, IntPtr pKey);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SensorsUtilsV2_IsKeyPresentInPropertyList' -Namespace Win32 -PassThru
# $api::IsKeyPresentInPropertyList(pList, pKey)#uselib "SensorsUtilsV2.dll"
#func global IsKeyPresentInPropertyList "IsKeyPresentInPropertyList" sptr, sptr
; IsKeyPresentInPropertyList varptr(pList), varptr(pKey) ; 戻り値は stat
; pList : SENSOR_PROPERTY_LIST* -> "sptr"
; pKey : PROPERTYKEY* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "SensorsUtilsV2.dll" #cfunc global IsKeyPresentInPropertyList "IsKeyPresentInPropertyList" var, var ; res = IsKeyPresentInPropertyList(pList, pKey) ; pList : SENSOR_PROPERTY_LIST* -> "var" ; pKey : PROPERTYKEY* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SensorsUtilsV2.dll" #cfunc global IsKeyPresentInPropertyList "IsKeyPresentInPropertyList" sptr, sptr ; res = IsKeyPresentInPropertyList(varptr(pList), varptr(pKey)) ; pList : SENSOR_PROPERTY_LIST* -> "sptr" ; pKey : PROPERTYKEY* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOLEAN IsKeyPresentInPropertyList(SENSOR_PROPERTY_LIST* pList, PROPERTYKEY* pKey) #uselib "SensorsUtilsV2.dll" #cfunc global IsKeyPresentInPropertyList "IsKeyPresentInPropertyList" var, var ; res = IsKeyPresentInPropertyList(pList, pKey) ; pList : SENSOR_PROPERTY_LIST* -> "var" ; pKey : PROPERTYKEY* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOLEAN IsKeyPresentInPropertyList(SENSOR_PROPERTY_LIST* pList, PROPERTYKEY* pKey) #uselib "SensorsUtilsV2.dll" #cfunc global IsKeyPresentInPropertyList "IsKeyPresentInPropertyList" intptr, intptr ; res = IsKeyPresentInPropertyList(varptr(pList), varptr(pKey)) ; pList : SENSOR_PROPERTY_LIST* -> "intptr" ; pKey : PROPERTYKEY* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
sensorsutilsv2 = windows.NewLazySystemDLL("SensorsUtilsV2.dll")
procIsKeyPresentInPropertyList = sensorsutilsv2.NewProc("IsKeyPresentInPropertyList")
)
// pList (SENSOR_PROPERTY_LIST*), pKey (PROPERTYKEY*)
r1, _, err := procIsKeyPresentInPropertyList.Call(
uintptr(pList),
uintptr(pKey),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLEANfunction IsKeyPresentInPropertyList(
pList: Pointer; // SENSOR_PROPERTY_LIST*
pKey: Pointer // PROPERTYKEY*
): ByteBool; stdcall;
external 'SensorsUtilsV2.dll' name 'IsKeyPresentInPropertyList';result := DllCall("SensorsUtilsV2\IsKeyPresentInPropertyList"
, "Ptr", pList ; SENSOR_PROPERTY_LIST*
, "Ptr", pKey ; PROPERTYKEY*
, "Char") ; return: BOOLEAN●IsKeyPresentInPropertyList(pList, pKey) = DLL("SensorsUtilsV2.dll", "byte IsKeyPresentInPropertyList(void*, void*)")
# 呼び出し: IsKeyPresentInPropertyList(pList, pKey)
# pList : SENSOR_PROPERTY_LIST* -> "void*"
# pKey : PROPERTYKEY* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。