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

GetGuide

関数
認識コンテキストの入力ガイド枠を取得する。
DLLinkobjcore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT GetGuide(
    HRECOCONTEXT hrc,
    RECO_GUIDE* pGuide,
    DWORD* piIndex
);

パラメーター

名前方向説明
hrcHRECOCONTEXTinガイドを取得する認識コンテキストのハンドル(HRECOCONTEXT)。
pGuideRECO_GUIDE*inout現在のガイド情報を受け取るRECO_GUIDE構造体へのポインタ。
piIndexDWORD*inout現在の開始セルインデックスを受け取るポインタ。

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

GetGuide = ctypes.windll.inkobjcore.GetGuide
GetGuide.restype = ctypes.c_int
GetGuide.argtypes = [
    wintypes.HANDLE,  # hrc : HRECOCONTEXT
    ctypes.c_void_p,  # pGuide : RECO_GUIDE* in/out
    ctypes.POINTER(wintypes.DWORD),  # piIndex : DWORD* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	inkobjcore = windows.NewLazySystemDLL("inkobjcore.dll")
	procGetGuide = inkobjcore.NewProc("GetGuide")
)

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

extern "inkobjcore" fn GetGuide(
    hrc: ?*anyopaque, // HRECOCONTEXT
    pGuide: [*c]RECO_GUIDE, // RECO_GUIDE* in/out
    piIndex: [*c]u32 // DWORD* in/out
) callconv(std.os.windows.WINAPI) i32;
proc GetGuide(
    hrc: pointer,  # HRECOCONTEXT
    pGuide: ptr RECO_GUIDE,  # RECO_GUIDE* in/out
    piIndex: ptr uint32  # DWORD* in/out
): int32 {.importc: "GetGuide", stdcall, dynlib: "inkobjcore.dll".}
pragma(lib, "inkobjcore");
extern(Windows)
int GetGuide(
    void* hrc,   // HRECOCONTEXT
    RECO_GUIDE* pGuide,   // RECO_GUIDE* in/out
    uint* piIndex   // DWORD* in/out
);
ccall((:GetGuide, "inkobjcore.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Ptr{RECO_GUIDE}, Ptr{UInt32}),
      hrc, pGuide, piIndex)
# hrc : HRECOCONTEXT -> Ptr{Cvoid}
# pGuide : RECO_GUIDE* in/out -> Ptr{RECO_GUIDE}
# piIndex : DWORD* in/out -> Ptr{UInt32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t GetGuide(
    void* hrc,
    void* pGuide,
    uint32_t* piIndex);
]]
local inkobjcore = ffi.load("inkobjcore")
-- inkobjcore.GetGuide(hrc, pGuide, piIndex)
-- hrc : HRECOCONTEXT
-- pGuide : RECO_GUIDE* in/out
-- piIndex : DWORD* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('inkobjcore.dll');
const GetGuide = lib.func('__stdcall', 'GetGuide', 'int32_t', ['void *', 'void *', 'uint32_t *']);
// GetGuide(hrc, pGuide, piIndex)
// hrc : HRECOCONTEXT -> 'void *'
// pGuide : RECO_GUIDE* in/out -> 'void *'
// piIndex : DWORD* in/out -> 'uint32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("inkobjcore.dll", {
  GetGuide: { parameters: ["pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.GetGuide(hrc, pGuide, piIndex)
// hrc : HRECOCONTEXT -> "pointer"
// pGuide : RECO_GUIDE* in/out -> "pointer"
// piIndex : DWORD* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t GetGuide(
    void* hrc,
    void* pGuide,
    uint32_t* piIndex);
C, "inkobjcore.dll");
// $ffi->GetGuide(hrc, pGuide, piIndex);
// hrc : HRECOCONTEXT
// pGuide : RECO_GUIDE* in/out
// piIndex : DWORD* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Inkobjcore extends StdCallLibrary {
    Inkobjcore INSTANCE = Native.load("inkobjcore", Inkobjcore.class);
    int GetGuide(
        Pointer hrc,   // HRECOCONTEXT
        Pointer pGuide,   // RECO_GUIDE* in/out
        IntByReference piIndex   // DWORD* in/out
    );
}
@[Link("inkobjcore")]
lib Libinkobjcore
  fun GetGuide = GetGuide(
    hrc : Void*,   # HRECOCONTEXT
    pGuide : RECO_GUIDE*,   # RECO_GUIDE* in/out
    piIndex : UInt32*   # DWORD* in/out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef GetGuideNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Uint32>);
typedef GetGuideDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Uint32>);
final GetGuide = DynamicLibrary.open('inkobjcore.dll')
    .lookupFunction<GetGuideNative, GetGuideDart>('GetGuide');
// hrc : HRECOCONTEXT -> Pointer<Void>
// pGuide : RECO_GUIDE* in/out -> Pointer<Void>
// piIndex : DWORD* in/out -> Pointer<Uint32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function GetGuide(
  hrc: THandle;   // HRECOCONTEXT
  pGuide: Pointer;   // RECO_GUIDE* in/out
  piIndex: Pointer   // DWORD* in/out
): Integer; stdcall;
  external 'inkobjcore.dll' name 'GetGuide';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "GetGuide"
  c_GetGuide :: Ptr () -> Ptr () -> Ptr Word32 -> IO Int32
-- hrc : HRECOCONTEXT -> Ptr ()
-- pGuide : RECO_GUIDE* in/out -> Ptr ()
-- piIndex : DWORD* in/out -> Ptr Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let getguide =
  foreign "GetGuide"
    ((ptr void) @-> (ptr void) @-> (ptr uint32_t) @-> returning int32_t)
(* hrc : HRECOCONTEXT -> (ptr void) *)
(* pGuide : RECO_GUIDE* in/out -> (ptr void) *)
(* piIndex : DWORD* in/out -> (ptr uint32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library inkobjcore (t "inkobjcore.dll"))
(cffi:use-foreign-library inkobjcore)

(cffi:defcfun ("GetGuide" get-guide :convention :stdcall) :int32
  (hrc :pointer)   ; HRECOCONTEXT
  (p-guide :pointer)   ; RECO_GUIDE* in/out
  (pi-index :pointer))   ; DWORD* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $GetGuide = Win32::API::More->new('inkobjcore',
    'int GetGuide(HANDLE hrc, LPVOID pGuide, LPVOID piIndex)');
# my $ret = $GetGuide->Call($hrc, $pGuide, $piIndex);
# hrc : HRECOCONTEXT -> HANDLE
# pGuide : RECO_GUIDE* in/out -> LPVOID
# piIndex : DWORD* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型