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

IsStringSupported

関数
認識エンジンが指定文字列を認識可能か判定する。
DLLinkobjcore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT IsStringSupported(
    HRECOCONTEXT hrc,
    DWORD wcString,
    LPCWSTR pwcString
);

パラメーター

名前方向
hrcHRECOCONTEXTin
wcStringDWORDin
pwcStringLPCWSTRin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT IsStringSupported(
    HRECOCONTEXT hrc,
    DWORD wcString,
    LPCWSTR pwcString
);
[DllImport("inkobjcore.dll", ExactSpelling = true)]
static extern int IsStringSupported(
    IntPtr hrc,   // HRECOCONTEXT
    uint wcString,   // DWORD
    [MarshalAs(UnmanagedType.LPWStr)] string pwcString   // LPCWSTR
);
<DllImport("inkobjcore.dll", ExactSpelling:=True)>
Public Shared Function IsStringSupported(
    hrc As IntPtr,   ' HRECOCONTEXT
    wcString As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPWStr)> pwcString As String   ' LPCWSTR
) As Integer
End Function
' hrc : HRECOCONTEXT
' wcString : DWORD
' pwcString : LPCWSTR
Declare PtrSafe Function IsStringSupported Lib "inkobjcore" ( _
    ByVal hrc As LongPtr, _
    ByVal wcString As Long, _
    ByVal pwcString As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

IsStringSupported = ctypes.windll.inkobjcore.IsStringSupported
IsStringSupported.restype = ctypes.c_int
IsStringSupported.argtypes = [
    wintypes.HANDLE,  # hrc : HRECOCONTEXT
    wintypes.DWORD,  # wcString : DWORD
    wintypes.LPCWSTR,  # pwcString : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('inkobjcore.dll')
IsStringSupported = Fiddle::Function.new(
  lib['IsStringSupported'],
  [
    Fiddle::TYPE_VOIDP,  # hrc : HRECOCONTEXT
    -Fiddle::TYPE_INT,  # wcString : DWORD
    Fiddle::TYPE_VOIDP,  # pwcString : LPCWSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "inkobjcore")]
extern "system" {
    fn IsStringSupported(
        hrc: *mut core::ffi::c_void,  // HRECOCONTEXT
        wcString: u32,  // DWORD
        pwcString: *const u16  // LPCWSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("inkobjcore.dll")]
public static extern int IsStringSupported(IntPtr hrc, uint wcString, [MarshalAs(UnmanagedType.LPWStr)] string pwcString);
"@
$api = Add-Type -MemberDefinition $sig -Name 'inkobjcore_IsStringSupported' -Namespace Win32 -PassThru
# $api::IsStringSupported(hrc, wcString, pwcString)
#uselib "inkobjcore.dll"
#func global IsStringSupported "IsStringSupported" sptr, sptr, sptr
; IsStringSupported hrc, wcString, pwcString   ; 戻り値は stat
; hrc : HRECOCONTEXT -> "sptr"
; wcString : DWORD -> "sptr"
; pwcString : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "inkobjcore.dll"
#cfunc global IsStringSupported "IsStringSupported" sptr, int, wstr
; res = IsStringSupported(hrc, wcString, pwcString)
; hrc : HRECOCONTEXT -> "sptr"
; wcString : DWORD -> "int"
; pwcString : LPCWSTR -> "wstr"
; HRESULT IsStringSupported(HRECOCONTEXT hrc, DWORD wcString, LPCWSTR pwcString)
#uselib "inkobjcore.dll"
#cfunc global IsStringSupported "IsStringSupported" intptr, int, wstr
; res = IsStringSupported(hrc, wcString, pwcString)
; hrc : HRECOCONTEXT -> "intptr"
; wcString : DWORD -> "int"
; pwcString : LPCWSTR -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	inkobjcore = windows.NewLazySystemDLL("inkobjcore.dll")
	procIsStringSupported = inkobjcore.NewProc("IsStringSupported")
)

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