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