Win32 API 日本語リファレンス
ホームUI.TextServices › TF_INPUTPROCESSORPROFILE

TF_INPUTPROCESSORPROFILE

構造体
サイズx64: 88 バイト / x86: 72 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwProfileTypeDWORD4+0+0プロファイルの種類(IME・キーボードレイアウト等)を示す値。
langidWORD2+4+4プロファイルの言語ID。
clsidGUID16+8+8テキストサービスのCLSID。キーボードレイアウト時は CLSID_NULL。
guidProfileGUID16+24+24言語プロファイルを一意に識別する GUID。
catidGUID16+40+40サービスのカテゴリを識別する GUID。
hklSubstituteHKL8/4+56+56代替キーボードレイアウトのハンドル。
dwCapsDWORD4+64+60プロファイルの機能(キャパビリティ)を示すフラグ。
hklHKL8/4+72+64対応するキーボードレイアウトのハンドル。
dwFlagsDWORD4+80+68プロファイルの状態(有効・既定等)を示すフラグ。

各言語での定義

#include <windows.h>

// TF_INPUTPROCESSORPROFILE  (x64 88 / x86 72 バイト)
typedef struct TF_INPUTPROCESSORPROFILE {
    DWORD dwProfileType;
    WORD langid;
    GUID clsid;
    GUID guidProfile;
    GUID catid;
    HKL hklSubstitute;
    DWORD dwCaps;
    HKL hkl;
    DWORD dwFlags;
} TF_INPUTPROCESSORPROFILE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TF_INPUTPROCESSORPROFILE
{
    public uint dwProfileType;
    public ushort langid;
    public Guid clsid;
    public Guid guidProfile;
    public Guid catid;
    public IntPtr hklSubstitute;
    public uint dwCaps;
    public IntPtr hkl;
    public uint dwFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TF_INPUTPROCESSORPROFILE
    Public dwProfileType As UInteger
    Public langid As UShort
    Public clsid As Guid
    Public guidProfile As Guid
    Public catid As Guid
    Public hklSubstitute As IntPtr
    Public dwCaps As UInteger
    Public hkl As IntPtr
    Public dwFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class TF_INPUTPROCESSORPROFILE(ctypes.Structure):
    _fields_ = [
        ("dwProfileType", wintypes.DWORD),
        ("langid", ctypes.c_ushort),
        ("clsid", GUID),
        ("guidProfile", GUID),
        ("catid", GUID),
        ("hklSubstitute", ctypes.c_void_p),
        ("dwCaps", wintypes.DWORD),
        ("hkl", ctypes.c_void_p),
        ("dwFlags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct TF_INPUTPROCESSORPROFILE {
    pub dwProfileType: u32,
    pub langid: u16,
    pub clsid: GUID,
    pub guidProfile: GUID,
    pub catid: GUID,
    pub hklSubstitute: *mut core::ffi::c_void,
    pub dwCaps: u32,
    pub hkl: *mut core::ffi::c_void,
    pub dwFlags: u32,
}
import "golang.org/x/sys/windows"

type TF_INPUTPROCESSORPROFILE struct {
	dwProfileType uint32
	langid uint16
	clsid windows.GUID
	guidProfile windows.GUID
	catid windows.GUID
	hklSubstitute uintptr
	dwCaps uint32
	hkl uintptr
	dwFlags uint32
}
type
  TF_INPUTPROCESSORPROFILE = record
    dwProfileType: DWORD;
    langid: Word;
    clsid: TGUID;
    guidProfile: TGUID;
    catid: TGUID;
    hklSubstitute: Pointer;
    dwCaps: DWORD;
    hkl: Pointer;
    dwFlags: DWORD;
  end;
const TF_INPUTPROCESSORPROFILE = extern struct {
    dwProfileType: u32,
    langid: u16,
    clsid: GUID,
    guidProfile: GUID,
    catid: GUID,
    hklSubstitute: ?*anyopaque,
    dwCaps: u32,
    hkl: ?*anyopaque,
    dwFlags: u32,
};
type
  TF_INPUTPROCESSORPROFILE {.bycopy.} = object
    dwProfileType: uint32
    langid: uint16
    clsid: GUID
    guidProfile: GUID
    catid: GUID
    hklSubstitute: pointer
    dwCaps: uint32
    hkl: pointer
    dwFlags: uint32
struct TF_INPUTPROCESSORPROFILE
{
    uint dwProfileType;
    ushort langid;
    GUID clsid;
    GUID guidProfile;
    GUID catid;
    void* hklSubstitute;
    uint dwCaps;
    void* hkl;
    uint dwFlags;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; TF_INPUTPROCESSORPROFILE サイズ: 72 バイト(x86)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwProfileType : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; langid : WORD (+4, 2byte)  wpoke st,4,値  /  値 = wpeek(st,4)
; clsid : GUID (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; guidProfile : GUID (+24, 16byte)  varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; catid : GUID (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; hklSubstitute : HKL (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; dwCaps : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; hkl : HKL (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwFlags : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TF_INPUTPROCESSORPROFILE サイズ: 88 バイト(x64)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; dwProfileType : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; langid : WORD (+4, 2byte)  wpoke st,4,値  /  値 = wpeek(st,4)
; clsid : GUID (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; guidProfile : GUID (+24, 16byte)  varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; catid : GUID (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; hklSubstitute : HKL (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; dwCaps : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; hkl : HKL (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; dwFlags : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global TF_INPUTPROCESSORPROFILE
    #field int dwProfileType
    #field short langid
    #field GUID clsid
    #field GUID guidProfile
    #field GUID catid
    #field intptr hklSubstitute
    #field int dwCaps
    #field intptr hkl
    #field int dwFlags
#endstruct

stdim st, TF_INPUTPROCESSORPROFILE        ; NSTRUCT 変数を確保
st->dwProfileType = 100
mes "dwProfileType=" + st->dwProfileType