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