ホーム › UI.TabletPC › GetContextPropertyValue
GetContextPropertyValue
関数認識コンテキストのプロパティ値を取得する。
シグネチャ
// inkobjcore.dll
#include <windows.h>
HRESULT GetContextPropertyValue(
HRECOCONTEXT hrc,
GUID* pGuid,
DWORD* pcbSize,
BYTE* pProperty
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hrc | HRECOCONTEXT | in |
| pGuid | GUID* | inout |
| pcbSize | DWORD* | inout |
| pProperty | BYTE* | inout |
戻り値の型: HRESULT
各言語での呼び出し定義
// inkobjcore.dll
#include <windows.h>
HRESULT GetContextPropertyValue(
HRECOCONTEXT hrc,
GUID* pGuid,
DWORD* pcbSize,
BYTE* pProperty
);[DllImport("inkobjcore.dll", ExactSpelling = true)]
static extern int GetContextPropertyValue(
IntPtr hrc, // HRECOCONTEXT
ref Guid pGuid, // GUID* in/out
ref uint pcbSize, // DWORD* in/out
IntPtr pProperty // BYTE* in/out
);<DllImport("inkobjcore.dll", ExactSpelling:=True)>
Public Shared Function GetContextPropertyValue(
hrc As IntPtr, ' HRECOCONTEXT
ByRef pGuid As Guid, ' GUID* in/out
ByRef pcbSize As UInteger, ' DWORD* in/out
pProperty As IntPtr ' BYTE* in/out
) As Integer
End Function' hrc : HRECOCONTEXT
' pGuid : GUID* in/out
' pcbSize : DWORD* in/out
' pProperty : BYTE* in/out
Declare PtrSafe Function GetContextPropertyValue Lib "inkobjcore" ( _
ByVal hrc As LongPtr, _
ByVal pGuid As LongPtr, _
ByRef pcbSize As Long, _
ByVal pProperty As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetContextPropertyValue = ctypes.windll.inkobjcore.GetContextPropertyValue
GetContextPropertyValue.restype = ctypes.c_int
GetContextPropertyValue.argtypes = [
wintypes.HANDLE, # hrc : HRECOCONTEXT
ctypes.c_void_p, # pGuid : GUID* in/out
ctypes.POINTER(wintypes.DWORD), # pcbSize : DWORD* in/out
ctypes.POINTER(ctypes.c_ubyte), # pProperty : BYTE* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('inkobjcore.dll')
GetContextPropertyValue = Fiddle::Function.new(
lib['GetContextPropertyValue'],
[
Fiddle::TYPE_VOIDP, # hrc : HRECOCONTEXT
Fiddle::TYPE_VOIDP, # pGuid : GUID* in/out
Fiddle::TYPE_VOIDP, # pcbSize : DWORD* in/out
Fiddle::TYPE_VOIDP, # pProperty : BYTE* in/out
],
Fiddle::TYPE_INT)#[link(name = "inkobjcore")]
extern "system" {
fn GetContextPropertyValue(
hrc: *mut core::ffi::c_void, // HRECOCONTEXT
pGuid: *mut GUID, // GUID* in/out
pcbSize: *mut u32, // DWORD* in/out
pProperty: *mut u8 // BYTE* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("inkobjcore.dll")]
public static extern int GetContextPropertyValue(IntPtr hrc, ref Guid pGuid, ref uint pcbSize, IntPtr pProperty);
"@
$api = Add-Type -MemberDefinition $sig -Name 'inkobjcore_GetContextPropertyValue' -Namespace Win32 -PassThru
# $api::GetContextPropertyValue(hrc, pGuid, pcbSize, pProperty)#uselib "inkobjcore.dll"
#func global GetContextPropertyValue "GetContextPropertyValue" sptr, sptr, sptr, sptr
; GetContextPropertyValue hrc, varptr(pGuid), varptr(pcbSize), varptr(pProperty) ; 戻り値は stat
; hrc : HRECOCONTEXT -> "sptr"
; pGuid : GUID* in/out -> "sptr"
; pcbSize : DWORD* in/out -> "sptr"
; pProperty : BYTE* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "inkobjcore.dll" #cfunc global GetContextPropertyValue "GetContextPropertyValue" sptr, var, var, var ; res = GetContextPropertyValue(hrc, pGuid, pcbSize, pProperty) ; hrc : HRECOCONTEXT -> "sptr" ; pGuid : GUID* in/out -> "var" ; pcbSize : DWORD* in/out -> "var" ; pProperty : BYTE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "inkobjcore.dll" #cfunc global GetContextPropertyValue "GetContextPropertyValue" sptr, sptr, sptr, sptr ; res = GetContextPropertyValue(hrc, varptr(pGuid), varptr(pcbSize), varptr(pProperty)) ; hrc : HRECOCONTEXT -> "sptr" ; pGuid : GUID* in/out -> "sptr" ; pcbSize : DWORD* in/out -> "sptr" ; pProperty : BYTE* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT GetContextPropertyValue(HRECOCONTEXT hrc, GUID* pGuid, DWORD* pcbSize, BYTE* pProperty) #uselib "inkobjcore.dll" #cfunc global GetContextPropertyValue "GetContextPropertyValue" intptr, var, var, var ; res = GetContextPropertyValue(hrc, pGuid, pcbSize, pProperty) ; hrc : HRECOCONTEXT -> "intptr" ; pGuid : GUID* in/out -> "var" ; pcbSize : DWORD* in/out -> "var" ; pProperty : BYTE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT GetContextPropertyValue(HRECOCONTEXT hrc, GUID* pGuid, DWORD* pcbSize, BYTE* pProperty) #uselib "inkobjcore.dll" #cfunc global GetContextPropertyValue "GetContextPropertyValue" intptr, intptr, intptr, intptr ; res = GetContextPropertyValue(hrc, varptr(pGuid), varptr(pcbSize), varptr(pProperty)) ; hrc : HRECOCONTEXT -> "intptr" ; pGuid : GUID* in/out -> "intptr" ; pcbSize : DWORD* in/out -> "intptr" ; pProperty : BYTE* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
inkobjcore = windows.NewLazySystemDLL("inkobjcore.dll")
procGetContextPropertyValue = inkobjcore.NewProc("GetContextPropertyValue")
)
// hrc (HRECOCONTEXT), pGuid (GUID* in/out), pcbSize (DWORD* in/out), pProperty (BYTE* in/out)
r1, _, err := procGetContextPropertyValue.Call(
uintptr(hrc),
uintptr(pGuid),
uintptr(pcbSize),
uintptr(pProperty),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction GetContextPropertyValue(
hrc: THandle; // HRECOCONTEXT
pGuid: PGUID; // GUID* in/out
pcbSize: Pointer; // DWORD* in/out
pProperty: Pointer // BYTE* in/out
): Integer; stdcall;
external 'inkobjcore.dll' name 'GetContextPropertyValue';result := DllCall("inkobjcore\GetContextPropertyValue"
, "Ptr", hrc ; HRECOCONTEXT
, "Ptr", pGuid ; GUID* in/out
, "Ptr", pcbSize ; DWORD* in/out
, "Ptr", pProperty ; BYTE* in/out
, "Int") ; return: HRESULT●GetContextPropertyValue(hrc, pGuid, pcbSize, pProperty) = DLL("inkobjcore.dll", "int GetContextPropertyValue(void*, void*, void*, void*)")
# 呼び出し: GetContextPropertyValue(hrc, pGuid, pcbSize, pProperty)
# hrc : HRECOCONTEXT -> "void*"
# pGuid : GUID* in/out -> "void*"
# pcbSize : DWORD* in/out -> "void*"
# pProperty : BYTE* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。