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