ホーム › Media.Multimedia › DrawDibGetPalette
DrawDibGetPalette
関数DrawDibが使用するパレットを取得する。
シグネチャ
// MSVFW32.dll
#include <windows.h>
HPALETTE DrawDibGetPalette(
INT_PTR hdd
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hdd | INT_PTR | in |
戻り値の型: HPALETTE
各言語での呼び出し定義
// MSVFW32.dll
#include <windows.h>
HPALETTE DrawDibGetPalette(
INT_PTR hdd
);[DllImport("MSVFW32.dll", ExactSpelling = true)]
static extern IntPtr DrawDibGetPalette(
IntPtr hdd // INT_PTR
);<DllImport("MSVFW32.dll", ExactSpelling:=True)>
Public Shared Function DrawDibGetPalette(
hdd As IntPtr ' INT_PTR
) As IntPtr
End Function' hdd : INT_PTR
Declare PtrSafe Function DrawDibGetPalette Lib "msvfw32" ( _
ByVal hdd As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DrawDibGetPalette = ctypes.windll.msvfw32.DrawDibGetPalette
DrawDibGetPalette.restype = ctypes.c_void_p
DrawDibGetPalette.argtypes = [
ctypes.c_ssize_t, # hdd : INT_PTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSVFW32.dll')
DrawDibGetPalette = Fiddle::Function.new(
lib['DrawDibGetPalette'],
[
Fiddle::TYPE_INTPTR_T, # hdd : INT_PTR
],
Fiddle::TYPE_VOIDP)#[link(name = "msvfw32")]
extern "system" {
fn DrawDibGetPalette(
hdd: isize // INT_PTR
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSVFW32.dll")]
public static extern IntPtr DrawDibGetPalette(IntPtr hdd);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSVFW32_DrawDibGetPalette' -Namespace Win32 -PassThru
# $api::DrawDibGetPalette(hdd)#uselib "MSVFW32.dll"
#func global DrawDibGetPalette "DrawDibGetPalette" sptr
; DrawDibGetPalette hdd ; 戻り値は stat
; hdd : INT_PTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MSVFW32.dll"
#cfunc global DrawDibGetPalette "DrawDibGetPalette" sptr
; res = DrawDibGetPalette(hdd)
; hdd : INT_PTR -> "sptr"; HPALETTE DrawDibGetPalette(INT_PTR hdd)
#uselib "MSVFW32.dll"
#cfunc global DrawDibGetPalette "DrawDibGetPalette" intptr
; res = DrawDibGetPalette(hdd)
; hdd : INT_PTR -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msvfw32 = windows.NewLazySystemDLL("MSVFW32.dll")
procDrawDibGetPalette = msvfw32.NewProc("DrawDibGetPalette")
)
// hdd (INT_PTR)
r1, _, err := procDrawDibGetPalette.Call(
uintptr(hdd),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HPALETTEfunction DrawDibGetPalette(
hdd: NativeInt // INT_PTR
): THandle; stdcall;
external 'MSVFW32.dll' name 'DrawDibGetPalette';result := DllCall("MSVFW32\DrawDibGetPalette"
, "Ptr", hdd ; INT_PTR
, "Ptr") ; return: HPALETTE●DrawDibGetPalette(hdd) = DLL("MSVFW32.dll", "void* DrawDibGetPalette(int)")
# 呼び出し: DrawDibGetPalette(hdd)
# hdd : INT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。