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

DestroyAlternate

関数
認識候補オブジェクトを破棄する。
DLLinkobjcore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT DestroyAlternate(
    HRECOALT hrcalt
);

パラメーター

名前方向説明
hrcaltHRECOALTin破棄する認識代替候補のハンドル(HRECOALT)。

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DestroyAlternate(
    HRECOALT hrcalt
);
[DllImport("inkobjcore.dll", ExactSpelling = true)]
static extern int DestroyAlternate(
    IntPtr hrcalt   // HRECOALT
);
<DllImport("inkobjcore.dll", ExactSpelling:=True)>
Public Shared Function DestroyAlternate(
    hrcalt As IntPtr   ' HRECOALT
) As Integer
End Function
' hrcalt : HRECOALT
Declare PtrSafe Function DestroyAlternate Lib "inkobjcore" ( _
    ByVal hrcalt As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DestroyAlternate = ctypes.windll.inkobjcore.DestroyAlternate
DestroyAlternate.restype = ctypes.c_int
DestroyAlternate.argtypes = [
    wintypes.HANDLE,  # hrcalt : HRECOALT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	inkobjcore = windows.NewLazySystemDLL("inkobjcore.dll")
	procDestroyAlternate = inkobjcore.NewProc("DestroyAlternate")
)

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

extern "inkobjcore" fn DestroyAlternate(
    hrcalt: ?*anyopaque // HRECOALT
) callconv(std.os.windows.WINAPI) i32;
proc DestroyAlternate(
    hrcalt: pointer  # HRECOALT
): int32 {.importc: "DestroyAlternate", stdcall, dynlib: "inkobjcore.dll".}
pragma(lib, "inkobjcore");
extern(Windows)
int DestroyAlternate(
    void* hrcalt   // HRECOALT
);
ccall((:DestroyAlternate, "inkobjcore.dll"), stdcall, Int32,
      (Ptr{Cvoid},),
      hrcalt)
# hrcalt : HRECOALT -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t DestroyAlternate(
    void* hrcalt);
]]
local inkobjcore = ffi.load("inkobjcore")
-- inkobjcore.DestroyAlternate(hrcalt)
-- hrcalt : HRECOALT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('inkobjcore.dll');
const DestroyAlternate = lib.func('__stdcall', 'DestroyAlternate', 'int32_t', ['void *']);
// DestroyAlternate(hrcalt)
// hrcalt : HRECOALT -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("inkobjcore.dll", {
  DestroyAlternate: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.DestroyAlternate(hrcalt)
// hrcalt : HRECOALT -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t DestroyAlternate(
    void* hrcalt);
C, "inkobjcore.dll");
// $ffi->DestroyAlternate(hrcalt);
// hrcalt : HRECOALT
// 構造体/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 DestroyAlternate(
        Pointer hrcalt   // HRECOALT
    );
}
@[Link("inkobjcore")]
lib Libinkobjcore
  fun DestroyAlternate = DestroyAlternate(
    hrcalt : Void*   # HRECOALT
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef DestroyAlternateNative = Int32 Function(Pointer<Void>);
typedef DestroyAlternateDart = int Function(Pointer<Void>);
final DestroyAlternate = DynamicLibrary.open('inkobjcore.dll')
    .lookupFunction<DestroyAlternateNative, DestroyAlternateDart>('DestroyAlternate');
// hrcalt : HRECOALT -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function DestroyAlternate(
  hrcalt: THandle   // HRECOALT
): Integer; stdcall;
  external 'inkobjcore.dll' name 'DestroyAlternate';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "DestroyAlternate"
  c_DestroyAlternate :: Ptr () -> IO Int32
-- hrcalt : HRECOALT -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let destroyalternate =
  foreign "DestroyAlternate"
    ((ptr void) @-> returning int32_t)
(* hrcalt : HRECOALT -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library inkobjcore (t "inkobjcore.dll"))
(cffi:use-foreign-library inkobjcore)

(cffi:defcfun ("DestroyAlternate" destroy-alternate :convention :stdcall) :int32
  (hrcalt :pointer))   ; HRECOALT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $DestroyAlternate = Win32::API::More->new('inkobjcore',
    'int DestroyAlternate(HANDLE hrcalt)');
# my $ret = $DestroyAlternate->Call($hrcalt);
# hrcalt : HRECOALT -> HANDLE
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。