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

GdipEndContainer

関数
指定した状態のグラフィックスコンテナを終了し元に戻す。
DLLgdiplus.dll呼出規約winapi

シグネチャ

// gdiplus.dll
#include <windows.h>

Status GdipEndContainer(
    GpGraphics* graphics,
    DWORD state
);

パラメーター

名前方向
graphicsGpGraphics*inout
stateDWORDin

戻り値の型: Status

各言語での呼び出し定義

// gdiplus.dll
#include <windows.h>

Status GdipEndContainer(
    GpGraphics* graphics,
    DWORD state
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipEndContainer(
    IntPtr graphics,   // GpGraphics* in/out
    uint state   // DWORD
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipEndContainer(
    graphics As IntPtr,   ' GpGraphics* in/out
    state As UInteger   ' DWORD
) As Integer
End Function
' graphics : GpGraphics* in/out
' state : DWORD
Declare PtrSafe Function GdipEndContainer Lib "gdiplus" ( _
    ByVal graphics As LongPtr, _
    ByVal state As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipEndContainer = ctypes.windll.gdiplus.GdipEndContainer
GdipEndContainer.restype = ctypes.c_int
GdipEndContainer.argtypes = [
    ctypes.c_void_p,  # graphics : GpGraphics* in/out
    wintypes.DWORD,  # state : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipEndContainer = Fiddle::Function.new(
  lib['GdipEndContainer'],
  [
    Fiddle::TYPE_VOIDP,  # graphics : GpGraphics* in/out
    -Fiddle::TYPE_INT,  # state : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipEndContainer(
        graphics: *mut GpGraphics,  // GpGraphics* in/out
        state: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipEndContainer(IntPtr graphics, uint state);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipEndContainer' -Namespace Win32 -PassThru
# $api::GdipEndContainer(graphics, state)
#uselib "gdiplus.dll"
#func global GdipEndContainer "GdipEndContainer" sptr, sptr
; GdipEndContainer varptr(graphics), state   ; 戻り値は stat
; graphics : GpGraphics* in/out -> "sptr"
; state : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipEndContainer "GdipEndContainer" var, int
; res = GdipEndContainer(graphics, state)
; graphics : GpGraphics* in/out -> "var"
; state : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipEndContainer(GpGraphics* graphics, DWORD state)
#uselib "gdiplus.dll"
#cfunc global GdipEndContainer "GdipEndContainer" var, int
; res = GdipEndContainer(graphics, state)
; graphics : GpGraphics* in/out -> "var"
; state : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipEndContainer = gdiplus.NewProc("GdipEndContainer")
)

// graphics (GpGraphics* in/out), state (DWORD)
r1, _, err := procGdipEndContainer.Call(
	uintptr(graphics),
	uintptr(state),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
function GdipEndContainer(
  graphics: Pointer;   // GpGraphics* in/out
  state: DWORD   // DWORD
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipEndContainer';
result := DllCall("gdiplus\GdipEndContainer"
    , "Ptr", graphics   ; GpGraphics* in/out
    , "UInt", state   ; DWORD
    , "Int")   ; return: Status
●GdipEndContainer(graphics, state) = DLL("gdiplus.dll", "int GdipEndContainer(void*, dword)")
# 呼び出し: GdipEndContainer(graphics, state)
# graphics : GpGraphics* in/out -> "void*"
# state : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。