ホーム › UI.Input.Ime › ImmEnumInputContext
ImmEnumInputContext
関数指定スレッドの入力コンテキストを列挙する。
シグネチャ
// IMM32.dll
#include <windows.h>
BOOL ImmEnumInputContext(
DWORD idThread,
IMCENUMPROC lpfn,
LPARAM lParam
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| idThread | DWORD | in |
| lpfn | IMCENUMPROC | in |
| lParam | LPARAM | in |
戻り値の型: BOOL
各言語での呼び出し定義
// IMM32.dll
#include <windows.h>
BOOL ImmEnumInputContext(
DWORD idThread,
IMCENUMPROC lpfn,
LPARAM lParam
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("IMM32.dll", ExactSpelling = true)]
static extern bool ImmEnumInputContext(
uint idThread, // DWORD
IntPtr lpfn, // IMCENUMPROC
IntPtr lParam // LPARAM
);<DllImport("IMM32.dll", ExactSpelling:=True)>
Public Shared Function ImmEnumInputContext(
idThread As UInteger, ' DWORD
lpfn As IntPtr, ' IMCENUMPROC
lParam As IntPtr ' LPARAM
) As Boolean
End Function' idThread : DWORD
' lpfn : IMCENUMPROC
' lParam : LPARAM
Declare PtrSafe Function ImmEnumInputContext Lib "imm32" ( _
ByVal idThread As Long, _
ByVal lpfn As LongPtr, _
ByVal lParam As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ImmEnumInputContext = ctypes.windll.imm32.ImmEnumInputContext
ImmEnumInputContext.restype = wintypes.BOOL
ImmEnumInputContext.argtypes = [
wintypes.DWORD, # idThread : DWORD
ctypes.c_void_p, # lpfn : IMCENUMPROC
ctypes.c_ssize_t, # lParam : LPARAM
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('IMM32.dll')
ImmEnumInputContext = Fiddle::Function.new(
lib['ImmEnumInputContext'],
[
-Fiddle::TYPE_INT, # idThread : DWORD
Fiddle::TYPE_VOIDP, # lpfn : IMCENUMPROC
Fiddle::TYPE_INTPTR_T, # lParam : LPARAM
],
Fiddle::TYPE_INT)#[link(name = "imm32")]
extern "system" {
fn ImmEnumInputContext(
idThread: u32, // DWORD
lpfn: *const core::ffi::c_void, // IMCENUMPROC
lParam: isize // LPARAM
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("IMM32.dll")]
public static extern bool ImmEnumInputContext(uint idThread, IntPtr lpfn, IntPtr lParam);
"@
$api = Add-Type -MemberDefinition $sig -Name 'IMM32_ImmEnumInputContext' -Namespace Win32 -PassThru
# $api::ImmEnumInputContext(idThread, lpfn, lParam)#uselib "IMM32.dll"
#func global ImmEnumInputContext "ImmEnumInputContext" sptr, sptr, sptr
; ImmEnumInputContext idThread, lpfn, lParam ; 戻り値は stat
; idThread : DWORD -> "sptr"
; lpfn : IMCENUMPROC -> "sptr"
; lParam : LPARAM -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "IMM32.dll"
#cfunc global ImmEnumInputContext "ImmEnumInputContext" int, sptr, sptr
; res = ImmEnumInputContext(idThread, lpfn, lParam)
; idThread : DWORD -> "int"
; lpfn : IMCENUMPROC -> "sptr"
; lParam : LPARAM -> "sptr"; BOOL ImmEnumInputContext(DWORD idThread, IMCENUMPROC lpfn, LPARAM lParam)
#uselib "IMM32.dll"
#cfunc global ImmEnumInputContext "ImmEnumInputContext" int, intptr, intptr
; res = ImmEnumInputContext(idThread, lpfn, lParam)
; idThread : DWORD -> "int"
; lpfn : IMCENUMPROC -> "intptr"
; lParam : LPARAM -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
imm32 = windows.NewLazySystemDLL("IMM32.dll")
procImmEnumInputContext = imm32.NewProc("ImmEnumInputContext")
)
// idThread (DWORD), lpfn (IMCENUMPROC), lParam (LPARAM)
r1, _, err := procImmEnumInputContext.Call(
uintptr(idThread),
uintptr(lpfn),
uintptr(lParam),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction ImmEnumInputContext(
idThread: DWORD; // DWORD
lpfn: Pointer; // IMCENUMPROC
lParam: NativeInt // LPARAM
): BOOL; stdcall;
external 'IMM32.dll' name 'ImmEnumInputContext';result := DllCall("IMM32\ImmEnumInputContext"
, "UInt", idThread ; DWORD
, "Ptr", lpfn ; IMCENUMPROC
, "Ptr", lParam ; LPARAM
, "Int") ; return: BOOL●ImmEnumInputContext(idThread, lpfn, lParam) = DLL("IMM32.dll", "bool ImmEnumInputContext(dword, void*, int)")
# 呼び出し: ImmEnumInputContext(idThread, lpfn, lParam)
# idThread : DWORD -> "dword"
# lpfn : IMCENUMPROC -> "void*"
# lParam : LPARAM -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。