Win32 API 日本語リファレンス
ホームDevices.Sensors › PropKeyFindKeyGetDouble

PropKeyFindKeyGetDouble

関数
コレクションリストから指定キーのDOUBLE値を取得する。
DLLSensorsUtilsV2.dll呼出規約winapi

シグネチャ

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

NTSTATUS PropKeyFindKeyGetDouble(
    const SENSOR_COLLECTION_LIST* pList,
    const PROPERTYKEY* pKey,
    DOUBLE* pRetValue
);

パラメーター

名前方向
pListSENSOR_COLLECTION_LIST*in
pKeyPROPERTYKEY*in
pRetValueDOUBLE*out

戻り値の型: NTSTATUS

各言語での呼び出し定義

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

NTSTATUS PropKeyFindKeyGetDouble(
    const SENSOR_COLLECTION_LIST* pList,
    const PROPERTYKEY* pKey,
    DOUBLE* pRetValue
);
[DllImport("SensorsUtilsV2.dll", ExactSpelling = true)]
static extern int PropKeyFindKeyGetDouble(
    IntPtr pList,   // SENSOR_COLLECTION_LIST*
    IntPtr pKey,   // PROPERTYKEY*
    out double pRetValue   // DOUBLE* out
);
<DllImport("SensorsUtilsV2.dll", ExactSpelling:=True)>
Public Shared Function PropKeyFindKeyGetDouble(
    pList As IntPtr,   ' SENSOR_COLLECTION_LIST*
    pKey As IntPtr,   ' PROPERTYKEY*
    <Out> ByRef pRetValue As Double   ' DOUBLE* out
) As Integer
End Function
' pList : SENSOR_COLLECTION_LIST*
' pKey : PROPERTYKEY*
' pRetValue : DOUBLE* out
Declare PtrSafe Function PropKeyFindKeyGetDouble Lib "sensorsutilsv2" ( _
    ByVal pList As LongPtr, _
    ByVal pKey As LongPtr, _
    ByRef pRetValue As Double) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PropKeyFindKeyGetDouble = ctypes.windll.sensorsutilsv2.PropKeyFindKeyGetDouble
PropKeyFindKeyGetDouble.restype = ctypes.c_int
PropKeyFindKeyGetDouble.argtypes = [
    ctypes.c_void_p,  # pList : SENSOR_COLLECTION_LIST*
    ctypes.c_void_p,  # pKey : PROPERTYKEY*
    ctypes.POINTER(ctypes.c_double),  # pRetValue : DOUBLE* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SensorsUtilsV2.dll')
PropKeyFindKeyGetDouble = Fiddle::Function.new(
  lib['PropKeyFindKeyGetDouble'],
  [
    Fiddle::TYPE_VOIDP,  # pList : SENSOR_COLLECTION_LIST*
    Fiddle::TYPE_VOIDP,  # pKey : PROPERTYKEY*
    Fiddle::TYPE_VOIDP,  # pRetValue : DOUBLE* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "sensorsutilsv2")]
extern "system" {
    fn PropKeyFindKeyGetDouble(
        pList: *const SENSOR_COLLECTION_LIST,  // SENSOR_COLLECTION_LIST*
        pKey: *const PROPERTYKEY,  // PROPERTYKEY*
        pRetValue: *mut f64  // DOUBLE* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SensorsUtilsV2.dll")]
public static extern int PropKeyFindKeyGetDouble(IntPtr pList, IntPtr pKey, out double pRetValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SensorsUtilsV2_PropKeyFindKeyGetDouble' -Namespace Win32 -PassThru
# $api::PropKeyFindKeyGetDouble(pList, pKey, pRetValue)
#uselib "SensorsUtilsV2.dll"
#func global PropKeyFindKeyGetDouble "PropKeyFindKeyGetDouble" sptr, sptr, sptr
; PropKeyFindKeyGetDouble varptr(pList), varptr(pKey), varptr(pRetValue)   ; 戻り値は stat
; pList : SENSOR_COLLECTION_LIST* -> "sptr"
; pKey : PROPERTYKEY* -> "sptr"
; pRetValue : DOUBLE* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "SensorsUtilsV2.dll"
#cfunc global PropKeyFindKeyGetDouble "PropKeyFindKeyGetDouble" var, var, var
; res = PropKeyFindKeyGetDouble(pList, pKey, pRetValue)
; pList : SENSOR_COLLECTION_LIST* -> "var"
; pKey : PROPERTYKEY* -> "var"
; pRetValue : DOUBLE* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; NTSTATUS PropKeyFindKeyGetDouble(SENSOR_COLLECTION_LIST* pList, PROPERTYKEY* pKey, DOUBLE* pRetValue)
#uselib "SensorsUtilsV2.dll"
#cfunc global PropKeyFindKeyGetDouble "PropKeyFindKeyGetDouble" var, var, var
; res = PropKeyFindKeyGetDouble(pList, pKey, pRetValue)
; pList : SENSOR_COLLECTION_LIST* -> "var"
; pKey : PROPERTYKEY* -> "var"
; pRetValue : DOUBLE* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	sensorsutilsv2 = windows.NewLazySystemDLL("SensorsUtilsV2.dll")
	procPropKeyFindKeyGetDouble = sensorsutilsv2.NewProc("PropKeyFindKeyGetDouble")
)

// pList (SENSOR_COLLECTION_LIST*), pKey (PROPERTYKEY*), pRetValue (DOUBLE* out)
r1, _, err := procPropKeyFindKeyGetDouble.Call(
	uintptr(pList),
	uintptr(pKey),
	uintptr(pRetValue),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // NTSTATUS
function PropKeyFindKeyGetDouble(
  pList: Pointer;   // SENSOR_COLLECTION_LIST*
  pKey: Pointer;   // PROPERTYKEY*
  pRetValue: Pointer   // DOUBLE* out
): Integer; stdcall;
  external 'SensorsUtilsV2.dll' name 'PropKeyFindKeyGetDouble';
result := DllCall("SensorsUtilsV2\PropKeyFindKeyGetDouble"
    , "Ptr", pList   ; SENSOR_COLLECTION_LIST*
    , "Ptr", pKey   ; PROPERTYKEY*
    , "Ptr", pRetValue   ; DOUBLE* out
    , "Int")   ; return: NTSTATUS
●PropKeyFindKeyGetDouble(pList, pKey, pRetValue) = DLL("SensorsUtilsV2.dll", "int PropKeyFindKeyGetDouble(void*, void*, void*)")
# 呼び出し: PropKeyFindKeyGetDouble(pList, pKey, pRetValue)
# pList : SENSOR_COLLECTION_LIST* -> "void*"
# pKey : PROPERTYKEY* -> "void*"
# pRetValue : DOUBLE* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。