Win32 API 日本語リファレンス
ホームGraphics.Printing › SETRESULT_INFO

SETRESULT_INFO

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

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

フィールド

フィールドサイズx64x86説明
cbSizeWORD2+0+0本構造体のサイズ(バイト単位)。
wReservedWORD2+2+2予約フィールド。0を設定する。
hSetResultHANDLE8/4+8+4結果を設定する対象のハンドル。
ResultLRESULT8/4+16+8設定する結果値(LRESULT)。

各言語での定義

#include <windows.h>

// SETRESULT_INFO  (x64 24 / x86 12 バイト)
typedef struct SETRESULT_INFO {
    WORD cbSize;
    WORD wReserved;
    HANDLE hSetResult;
    LRESULT Result;
} SETRESULT_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SETRESULT_INFO
{
    public ushort cbSize;
    public ushort wReserved;
    public IntPtr hSetResult;
    public IntPtr Result;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SETRESULT_INFO
    Public cbSize As UShort
    Public wReserved As UShort
    Public hSetResult As IntPtr
    Public Result As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class SETRESULT_INFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", ctypes.c_ushort),
        ("wReserved", ctypes.c_ushort),
        ("hSetResult", ctypes.c_void_p),
        ("Result", ctypes.c_ssize_t),
    ]
#[repr(C)]
pub struct SETRESULT_INFO {
    pub cbSize: u16,
    pub wReserved: u16,
    pub hSetResult: *mut core::ffi::c_void,
    pub Result: isize,
}
import "golang.org/x/sys/windows"

type SETRESULT_INFO struct {
	cbSize uint16
	wReserved uint16
	hSetResult uintptr
	Result uintptr
}
type
  SETRESULT_INFO = record
    cbSize: Word;
    wReserved: Word;
    hSetResult: Pointer;
    Result: NativeInt;
  end;
const SETRESULT_INFO = extern struct {
    cbSize: u16,
    wReserved: u16,
    hSetResult: ?*anyopaque,
    Result: isize,
};
type
  SETRESULT_INFO {.bycopy.} = object
    cbSize: uint16
    wReserved: uint16
    hSetResult: pointer
    Result: int
struct SETRESULT_INFO
{
    ushort cbSize;
    ushort wReserved;
    void* hSetResult;
    ptrdiff_t Result;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SETRESULT_INFO サイズ: 12 バイト(x86)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; cbSize : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; wReserved : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; hSetResult : HANDLE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Result : LRESULT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SETRESULT_INFO サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : WORD (+0, 2byte)  wpoke st,0,値  /  値 = wpeek(st,0)
; wReserved : WORD (+2, 2byte)  wpoke st,2,値  /  値 = wpeek(st,2)
; hSetResult : HANDLE (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Result : LRESULT (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SETRESULT_INFO
    #field short cbSize
    #field short wReserved
    #field intptr hSetResult
    #field intptr Result
#endstruct

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