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

RealizePalette

関数
論理パレットをシステムパレットへ反映する。
DLLGDI32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD RealizePalette(
    HDC hdc
);

パラメーター

名前方向
hdcHDCin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD RealizePalette(
    HDC hdc
);
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern uint RealizePalette(
    IntPtr hdc   // HDC
);
<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function RealizePalette(
    hdc As IntPtr   ' HDC
) As UInteger
End Function
' hdc : HDC
Declare PtrSafe Function RealizePalette Lib "gdi32" ( _
    ByVal hdc As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RealizePalette = ctypes.windll.gdi32.RealizePalette
RealizePalette.restype = wintypes.DWORD
RealizePalette.argtypes = [
    wintypes.HANDLE,  # hdc : HDC
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('GDI32.dll')
RealizePalette = Fiddle::Function.new(
  lib['RealizePalette'],
  [
    Fiddle::TYPE_VOIDP,  # hdc : HDC
  ],
  -Fiddle::TYPE_INT)
#[link(name = "gdi32")]
extern "system" {
    fn RealizePalette(
        hdc: *mut core::ffi::c_void  // HDC
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("GDI32.dll")]
public static extern uint RealizePalette(IntPtr hdc);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_RealizePalette' -Namespace Win32 -PassThru
# $api::RealizePalette(hdc)
#uselib "GDI32.dll"
#func global RealizePalette "RealizePalette" sptr
; RealizePalette hdc   ; 戻り値は stat
; hdc : HDC -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "GDI32.dll"
#cfunc global RealizePalette "RealizePalette" sptr
; res = RealizePalette(hdc)
; hdc : HDC -> "sptr"
; DWORD RealizePalette(HDC hdc)
#uselib "GDI32.dll"
#cfunc global RealizePalette "RealizePalette" intptr
; res = RealizePalette(hdc)
; hdc : HDC -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdi32 = windows.NewLazySystemDLL("GDI32.dll")
	procRealizePalette = gdi32.NewProc("RealizePalette")
)

// hdc (HDC)
r1, _, err := procRealizePalette.Call(
	uintptr(hdc),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function RealizePalette(
  hdc: THandle   // HDC
): DWORD; stdcall;
  external 'GDI32.dll' name 'RealizePalette';
result := DllCall("GDI32\RealizePalette"
    , "Ptr", hdc   ; HDC
    , "UInt")   ; return: DWORD
●RealizePalette(hdc) = DLL("GDI32.dll", "dword RealizePalette(void*)")
# 呼び出し: RealizePalette(hdc)
# hdc : HDC -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。