Win32 API 日本語リファレンス
ホームUI.TabletPC › GetContextPropertyList

GetContextPropertyList

関数
認識コンテキストが対応するプロパティ一覧を取得する。
DLLinkobjcore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT GetContextPropertyList(
    HRECOCONTEXT hrc,
    DWORD* pcProperties,
    GUID* pPropertyGUIDS
);

パラメーター

名前方向
hrcHRECOCONTEXTin
pcPropertiesDWORD*inout
pPropertyGUIDSGUID*inout

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT GetContextPropertyList(
    HRECOCONTEXT hrc,
    DWORD* pcProperties,
    GUID* pPropertyGUIDS
);
[DllImport("inkobjcore.dll", ExactSpelling = true)]
static extern int GetContextPropertyList(
    IntPtr hrc,   // HRECOCONTEXT
    ref uint pcProperties,   // DWORD* in/out
    ref Guid pPropertyGUIDS   // GUID* in/out
);
<DllImport("inkobjcore.dll", ExactSpelling:=True)>
Public Shared Function GetContextPropertyList(
    hrc As IntPtr,   ' HRECOCONTEXT
    ByRef pcProperties As UInteger,   ' DWORD* in/out
    ByRef pPropertyGUIDS As Guid   ' GUID* in/out
) As Integer
End Function
' hrc : HRECOCONTEXT
' pcProperties : DWORD* in/out
' pPropertyGUIDS : GUID* in/out
Declare PtrSafe Function GetContextPropertyList Lib "inkobjcore" ( _
    ByVal hrc As LongPtr, _
    ByRef pcProperties As Long, _
    ByVal pPropertyGUIDS As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetContextPropertyList = ctypes.windll.inkobjcore.GetContextPropertyList
GetContextPropertyList.restype = ctypes.c_int
GetContextPropertyList.argtypes = [
    wintypes.HANDLE,  # hrc : HRECOCONTEXT
    ctypes.POINTER(wintypes.DWORD),  # pcProperties : DWORD* in/out
    ctypes.c_void_p,  # pPropertyGUIDS : GUID* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('inkobjcore.dll')
GetContextPropertyList = Fiddle::Function.new(
  lib['GetContextPropertyList'],
  [
    Fiddle::TYPE_VOIDP,  # hrc : HRECOCONTEXT
    Fiddle::TYPE_VOIDP,  # pcProperties : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # pPropertyGUIDS : GUID* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "inkobjcore")]
extern "system" {
    fn GetContextPropertyList(
        hrc: *mut core::ffi::c_void,  // HRECOCONTEXT
        pcProperties: *mut u32,  // DWORD* in/out
        pPropertyGUIDS: *mut GUID  // GUID* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("inkobjcore.dll")]
public static extern int GetContextPropertyList(IntPtr hrc, ref uint pcProperties, ref Guid pPropertyGUIDS);
"@
$api = Add-Type -MemberDefinition $sig -Name 'inkobjcore_GetContextPropertyList' -Namespace Win32 -PassThru
# $api::GetContextPropertyList(hrc, pcProperties, pPropertyGUIDS)
#uselib "inkobjcore.dll"
#func global GetContextPropertyList "GetContextPropertyList" sptr, sptr, sptr
; GetContextPropertyList hrc, varptr(pcProperties), varptr(pPropertyGUIDS)   ; 戻り値は stat
; hrc : HRECOCONTEXT -> "sptr"
; pcProperties : DWORD* in/out -> "sptr"
; pPropertyGUIDS : GUID* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "inkobjcore.dll"
#cfunc global GetContextPropertyList "GetContextPropertyList" sptr, var, var
; res = GetContextPropertyList(hrc, pcProperties, pPropertyGUIDS)
; hrc : HRECOCONTEXT -> "sptr"
; pcProperties : DWORD* in/out -> "var"
; pPropertyGUIDS : GUID* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT GetContextPropertyList(HRECOCONTEXT hrc, DWORD* pcProperties, GUID* pPropertyGUIDS)
#uselib "inkobjcore.dll"
#cfunc global GetContextPropertyList "GetContextPropertyList" intptr, var, var
; res = GetContextPropertyList(hrc, pcProperties, pPropertyGUIDS)
; hrc : HRECOCONTEXT -> "intptr"
; pcProperties : DWORD* in/out -> "var"
; pPropertyGUIDS : GUID* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	inkobjcore = windows.NewLazySystemDLL("inkobjcore.dll")
	procGetContextPropertyList = inkobjcore.NewProc("GetContextPropertyList")
)

// hrc (HRECOCONTEXT), pcProperties (DWORD* in/out), pPropertyGUIDS (GUID* in/out)
r1, _, err := procGetContextPropertyList.Call(
	uintptr(hrc),
	uintptr(pcProperties),
	uintptr(pPropertyGUIDS),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function GetContextPropertyList(
  hrc: THandle;   // HRECOCONTEXT
  pcProperties: Pointer;   // DWORD* in/out
  pPropertyGUIDS: PGUID   // GUID* in/out
): Integer; stdcall;
  external 'inkobjcore.dll' name 'GetContextPropertyList';
result := DllCall("inkobjcore\GetContextPropertyList"
    , "Ptr", hrc   ; HRECOCONTEXT
    , "Ptr", pcProperties   ; DWORD* in/out
    , "Ptr", pPropertyGUIDS   ; GUID* in/out
    , "Int")   ; return: HRESULT
●GetContextPropertyList(hrc, pcProperties, pPropertyGUIDS) = DLL("inkobjcore.dll", "int GetContextPropertyList(void*, void*, void*)")
# 呼び出し: GetContextPropertyList(hrc, pcProperties, pPropertyGUIDS)
# hrc : HRECOCONTEXT -> "void*"
# pcProperties : DWORD* in/out -> "void*"
# pPropertyGUIDS : GUID* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。