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