ホーム › UI.Input.Ime › ImmRequestMessageW
ImmRequestMessageW
関数IMEからアプリケーションへメッセージを要求する(Unicode版)。
シグネチャ
// IMM32.dll (Unicode / -W)
#include <windows.h>
LRESULT ImmRequestMessageW(
HIMC param0,
WPARAM param1,
LPARAM param2
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| param0 | HIMC | in |
| param1 | WPARAM | in |
| param2 | LPARAM | in |
戻り値の型: LRESULT
各言語での呼び出し定義
// IMM32.dll (Unicode / -W)
#include <windows.h>
LRESULT ImmRequestMessageW(
HIMC param0,
WPARAM param1,
LPARAM param2
);[DllImport("IMM32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern IntPtr ImmRequestMessageW(
IntPtr param0, // HIMC
UIntPtr param1, // WPARAM
IntPtr param2 // LPARAM
);<DllImport("IMM32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function ImmRequestMessageW(
param0 As IntPtr, ' HIMC
param1 As UIntPtr, ' WPARAM
param2 As IntPtr ' LPARAM
) As IntPtr
End Function' param0 : HIMC
' param1 : WPARAM
' param2 : LPARAM
Declare PtrSafe Function ImmRequestMessageW Lib "imm32" ( _
ByVal param0 As LongPtr, _
ByVal param1 As LongPtr, _
ByVal param2 As LongPtr) As LongPtr
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ImmRequestMessageW = ctypes.windll.imm32.ImmRequestMessageW
ImmRequestMessageW.restype = ctypes.c_ssize_t
ImmRequestMessageW.argtypes = [
wintypes.HANDLE, # param0 : HIMC
ctypes.c_size_t, # param1 : WPARAM
ctypes.c_ssize_t, # param2 : LPARAM
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('IMM32.dll')
ImmRequestMessageW = Fiddle::Function.new(
lib['ImmRequestMessageW'],
[
Fiddle::TYPE_VOIDP, # param0 : HIMC
Fiddle::TYPE_UINTPTR_T, # param1 : WPARAM
Fiddle::TYPE_INTPTR_T, # param2 : LPARAM
],
Fiddle::TYPE_INTPTR_T)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "imm32")]
extern "system" {
fn ImmRequestMessageW(
param0: *mut core::ffi::c_void, // HIMC
param1: usize, // WPARAM
param2: isize // LPARAM
) -> isize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("IMM32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr ImmRequestMessageW(IntPtr param0, UIntPtr param1, IntPtr param2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'IMM32_ImmRequestMessageW' -Namespace Win32 -PassThru
# $api::ImmRequestMessageW(param0, param1, param2)#uselib "IMM32.dll"
#func global ImmRequestMessageW "ImmRequestMessageW" wptr, wptr, wptr
; ImmRequestMessageW param0, param1, param2 ; 戻り値は stat
; param0 : HIMC -> "wptr"
; param1 : WPARAM -> "wptr"
; param2 : LPARAM -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "IMM32.dll"
#cfunc global ImmRequestMessageW "ImmRequestMessageW" sptr, sptr, sptr
; res = ImmRequestMessageW(param0, param1, param2)
; param0 : HIMC -> "sptr"
; param1 : WPARAM -> "sptr"
; param2 : LPARAM -> "sptr"; LRESULT ImmRequestMessageW(HIMC param0, WPARAM param1, LPARAM param2)
#uselib "IMM32.dll"
#cfunc global ImmRequestMessageW "ImmRequestMessageW" intptr, intptr, intptr
; res = ImmRequestMessageW(param0, param1, param2)
; param0 : HIMC -> "intptr"
; param1 : WPARAM -> "intptr"
; param2 : LPARAM -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
imm32 = windows.NewLazySystemDLL("IMM32.dll")
procImmRequestMessageW = imm32.NewProc("ImmRequestMessageW")
)
// param0 (HIMC), param1 (WPARAM), param2 (LPARAM)
r1, _, err := procImmRequestMessageW.Call(
uintptr(param0),
uintptr(param1),
uintptr(param2),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // LRESULTfunction ImmRequestMessageW(
param0: THandle; // HIMC
param1: NativeUInt; // WPARAM
param2: NativeInt // LPARAM
): NativeInt; stdcall;
external 'IMM32.dll' name 'ImmRequestMessageW';result := DllCall("IMM32\ImmRequestMessageW"
, "Ptr", param0 ; HIMC
, "UPtr", param1 ; WPARAM
, "Ptr", param2 ; LPARAM
, "Ptr") ; return: LRESULT●ImmRequestMessageW(param0, param1, param2) = DLL("IMM32.dll", "int ImmRequestMessageW(void*, int, int)")
# 呼び出し: ImmRequestMessageW(param0, param1, param2)
# param0 : HIMC -> "void*"
# param1 : WPARAM -> "int"
# param2 : LPARAM -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。