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

GdiplusStartupInput

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

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

フィールド

フィールドサイズx64x86説明
GdiplusVersionDWORD4+0+0使用するGDI+のバージョン番号を表す。通常は1。
DebugEventCallbackINT_PTR8/4+8+4デバッグイベントを受け取るコールバック関数へのポインタ。NULL可。
SuppressBackgroundThreadBOOL4+16+8バックグラウンドスレッドを抑止するかを示すフラグ。
SuppressExternalCodecsBOOL4+20+12外部画像コーデックの使用を抑止するかを示すフラグ。

各言語での定義

#include <windows.h>

// GdiplusStartupInput  (x64 24 / x86 16 バイト)
typedef struct GdiplusStartupInput {
    DWORD GdiplusVersion;
    INT_PTR DebugEventCallback;
    BOOL SuppressBackgroundThread;
    BOOL SuppressExternalCodecs;
} GdiplusStartupInput;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GdiplusStartupInput
{
    public uint GdiplusVersion;
    public IntPtr DebugEventCallback;
    [MarshalAs(UnmanagedType.Bool)] public bool SuppressBackgroundThread;
    [MarshalAs(UnmanagedType.Bool)] public bool SuppressExternalCodecs;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GdiplusStartupInput
    Public GdiplusVersion As UInteger
    Public DebugEventCallback As IntPtr
    <MarshalAs(UnmanagedType.Bool)> Public SuppressBackgroundThread As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public SuppressExternalCodecs As Boolean
End Structure
import ctypes
from ctypes import wintypes

class GdiplusStartupInput(ctypes.Structure):
    _fields_ = [
        ("GdiplusVersion", wintypes.DWORD),
        ("DebugEventCallback", ctypes.c_ssize_t),
        ("SuppressBackgroundThread", wintypes.BOOL),
        ("SuppressExternalCodecs", wintypes.BOOL),
    ]
#[repr(C)]
pub struct GdiplusStartupInput {
    pub GdiplusVersion: u32,
    pub DebugEventCallback: isize,
    pub SuppressBackgroundThread: i32,
    pub SuppressExternalCodecs: i32,
}
import "golang.org/x/sys/windows"

type GdiplusStartupInput struct {
	GdiplusVersion uint32
	DebugEventCallback uintptr
	SuppressBackgroundThread int32
	SuppressExternalCodecs int32
}
type
  GdiplusStartupInput = record
    GdiplusVersion: DWORD;
    DebugEventCallback: NativeInt;
    SuppressBackgroundThread: BOOL;
    SuppressExternalCodecs: BOOL;
  end;
const GdiplusStartupInput = extern struct {
    GdiplusVersion: u32,
    DebugEventCallback: isize,
    SuppressBackgroundThread: i32,
    SuppressExternalCodecs: i32,
};
type
  GdiplusStartupInput {.bycopy.} = object
    GdiplusVersion: uint32
    DebugEventCallback: int
    SuppressBackgroundThread: int32
    SuppressExternalCodecs: int32
struct GdiplusStartupInput
{
    uint GdiplusVersion;
    ptrdiff_t DebugEventCallback;
    int SuppressBackgroundThread;
    int SuppressExternalCodecs;
}

HSP用 定義

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

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

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