Win32 API 日本語リファレンス
ホームUI.Input.Ime › RECONVERTSTRING

RECONVERTSTRING

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0本構造体と文字列を含む全体サイズである。
dwVersionDWORD4+4+4構造体のバージョンである。通常0。
dwStrLenDWORD4+8+8再変換対象文字列全体の文字数である。
dwStrOffsetDWORD4+12+12文字列先頭への本構造体からのオフセットである。
dwCompStrLenDWORD4+16+16変換対象部分の文字数である。
dwCompStrOffsetDWORD4+20+20変換対象部分先頭へのオフセットである。
dwTargetStrLenDWORD4+24+24注目文節の文字数である。
dwTargetStrOffsetDWORD4+28+28注目文節先頭へのオフセットである。

各言語での定義

#include <windows.h>

// RECONVERTSTRING  (x64 32 / x86 32 バイト)
typedef struct RECONVERTSTRING {
    DWORD dwSize;
    DWORD dwVersion;
    DWORD dwStrLen;
    DWORD dwStrOffset;
    DWORD dwCompStrLen;
    DWORD dwCompStrOffset;
    DWORD dwTargetStrLen;
    DWORD dwTargetStrOffset;
} RECONVERTSTRING;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECONVERTSTRING
{
    public uint dwSize;
    public uint dwVersion;
    public uint dwStrLen;
    public uint dwStrOffset;
    public uint dwCompStrLen;
    public uint dwCompStrOffset;
    public uint dwTargetStrLen;
    public uint dwTargetStrOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECONVERTSTRING
    Public dwSize As UInteger
    Public dwVersion As UInteger
    Public dwStrLen As UInteger
    Public dwStrOffset As UInteger
    Public dwCompStrLen As UInteger
    Public dwCompStrOffset As UInteger
    Public dwTargetStrLen As UInteger
    Public dwTargetStrOffset As UInteger
End Structure
import ctypes
from ctypes import wintypes

class RECONVERTSTRING(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwVersion", wintypes.DWORD),
        ("dwStrLen", wintypes.DWORD),
        ("dwStrOffset", wintypes.DWORD),
        ("dwCompStrLen", wintypes.DWORD),
        ("dwCompStrOffset", wintypes.DWORD),
        ("dwTargetStrLen", wintypes.DWORD),
        ("dwTargetStrOffset", wintypes.DWORD),
    ]
#[repr(C)]
pub struct RECONVERTSTRING {
    pub dwSize: u32,
    pub dwVersion: u32,
    pub dwStrLen: u32,
    pub dwStrOffset: u32,
    pub dwCompStrLen: u32,
    pub dwCompStrOffset: u32,
    pub dwTargetStrLen: u32,
    pub dwTargetStrOffset: u32,
}
import "golang.org/x/sys/windows"

type RECONVERTSTRING struct {
	dwSize uint32
	dwVersion uint32
	dwStrLen uint32
	dwStrOffset uint32
	dwCompStrLen uint32
	dwCompStrOffset uint32
	dwTargetStrLen uint32
	dwTargetStrOffset uint32
}
type
  RECONVERTSTRING = record
    dwSize: DWORD;
    dwVersion: DWORD;
    dwStrLen: DWORD;
    dwStrOffset: DWORD;
    dwCompStrLen: DWORD;
    dwCompStrOffset: DWORD;
    dwTargetStrLen: DWORD;
    dwTargetStrOffset: DWORD;
  end;
const RECONVERTSTRING = extern struct {
    dwSize: u32,
    dwVersion: u32,
    dwStrLen: u32,
    dwStrOffset: u32,
    dwCompStrLen: u32,
    dwCompStrOffset: u32,
    dwTargetStrLen: u32,
    dwTargetStrOffset: u32,
};
type
  RECONVERTSTRING {.bycopy.} = object
    dwSize: uint32
    dwVersion: uint32
    dwStrLen: uint32
    dwStrOffset: uint32
    dwCompStrLen: uint32
    dwCompStrOffset: uint32
    dwTargetStrLen: uint32
    dwTargetStrOffset: uint32
struct RECONVERTSTRING
{
    uint dwSize;
    uint dwVersion;
    uint dwStrLen;
    uint dwStrOffset;
    uint dwCompStrLen;
    uint dwCompStrOffset;
    uint dwTargetStrLen;
    uint dwTargetStrOffset;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RECONVERTSTRING サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwVersion : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwStrLen : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwStrOffset : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwCompStrLen : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwCompStrOffset : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwTargetStrLen : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwTargetStrOffset : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RECONVERTSTRING
    #field int dwSize
    #field int dwVersion
    #field int dwStrLen
    #field int dwStrOffset
    #field int dwCompStrLen
    #field int dwCompStrOffset
    #field int dwTargetStrLen
    #field int dwTargetStrOffset
#endstruct

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