ホーム › UI.Controls › BufferedPaintSetAlpha
BufferedPaintSetAlpha
関数バッファの指定矩形にアルファ値を設定する。
シグネチャ
// UxTheme.dll
#include <windows.h>
HRESULT BufferedPaintSetAlpha(
INT_PTR hBufferedPaint,
const RECT* prc, // optional
BYTE alpha
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hBufferedPaint | INT_PTR | in |
| prc | RECT* | inoptional |
| alpha | BYTE | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// UxTheme.dll
#include <windows.h>
HRESULT BufferedPaintSetAlpha(
INT_PTR hBufferedPaint,
const RECT* prc, // optional
BYTE alpha
);[DllImport("UxTheme.dll", ExactSpelling = true)]
static extern int BufferedPaintSetAlpha(
IntPtr hBufferedPaint, // INT_PTR
IntPtr prc, // RECT* optional
byte alpha // BYTE
);<DllImport("UxTheme.dll", ExactSpelling:=True)>
Public Shared Function BufferedPaintSetAlpha(
hBufferedPaint As IntPtr, ' INT_PTR
prc As IntPtr, ' RECT* optional
alpha As Byte ' BYTE
) As Integer
End Function' hBufferedPaint : INT_PTR
' prc : RECT* optional
' alpha : BYTE
Declare PtrSafe Function BufferedPaintSetAlpha Lib "uxtheme" ( _
ByVal hBufferedPaint As LongPtr, _
ByVal prc As LongPtr, _
ByVal alpha As Byte) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
BufferedPaintSetAlpha = ctypes.windll.uxtheme.BufferedPaintSetAlpha
BufferedPaintSetAlpha.restype = ctypes.c_int
BufferedPaintSetAlpha.argtypes = [
ctypes.c_ssize_t, # hBufferedPaint : INT_PTR
ctypes.c_void_p, # prc : RECT* optional
ctypes.c_ubyte, # alpha : BYTE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('UxTheme.dll')
BufferedPaintSetAlpha = Fiddle::Function.new(
lib['BufferedPaintSetAlpha'],
[
Fiddle::TYPE_INTPTR_T, # hBufferedPaint : INT_PTR
Fiddle::TYPE_VOIDP, # prc : RECT* optional
-Fiddle::TYPE_CHAR, # alpha : BYTE
],
Fiddle::TYPE_INT)#[link(name = "uxtheme")]
extern "system" {
fn BufferedPaintSetAlpha(
hBufferedPaint: isize, // INT_PTR
prc: *const RECT, // RECT* optional
alpha: u8 // BYTE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("UxTheme.dll")]
public static extern int BufferedPaintSetAlpha(IntPtr hBufferedPaint, IntPtr prc, byte alpha);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UxTheme_BufferedPaintSetAlpha' -Namespace Win32 -PassThru
# $api::BufferedPaintSetAlpha(hBufferedPaint, prc, alpha)#uselib "UxTheme.dll"
#func global BufferedPaintSetAlpha "BufferedPaintSetAlpha" sptr, sptr, sptr
; BufferedPaintSetAlpha hBufferedPaint, varptr(prc), alpha ; 戻り値は stat
; hBufferedPaint : INT_PTR -> "sptr"
; prc : RECT* optional -> "sptr"
; alpha : BYTE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "UxTheme.dll" #cfunc global BufferedPaintSetAlpha "BufferedPaintSetAlpha" sptr, var, int ; res = BufferedPaintSetAlpha(hBufferedPaint, prc, alpha) ; hBufferedPaint : INT_PTR -> "sptr" ; prc : RECT* optional -> "var" ; alpha : BYTE -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "UxTheme.dll" #cfunc global BufferedPaintSetAlpha "BufferedPaintSetAlpha" sptr, sptr, int ; res = BufferedPaintSetAlpha(hBufferedPaint, varptr(prc), alpha) ; hBufferedPaint : INT_PTR -> "sptr" ; prc : RECT* optional -> "sptr" ; alpha : BYTE -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT BufferedPaintSetAlpha(INT_PTR hBufferedPaint, RECT* prc, BYTE alpha) #uselib "UxTheme.dll" #cfunc global BufferedPaintSetAlpha "BufferedPaintSetAlpha" intptr, var, int ; res = BufferedPaintSetAlpha(hBufferedPaint, prc, alpha) ; hBufferedPaint : INT_PTR -> "intptr" ; prc : RECT* optional -> "var" ; alpha : BYTE -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT BufferedPaintSetAlpha(INT_PTR hBufferedPaint, RECT* prc, BYTE alpha) #uselib "UxTheme.dll" #cfunc global BufferedPaintSetAlpha "BufferedPaintSetAlpha" intptr, intptr, int ; res = BufferedPaintSetAlpha(hBufferedPaint, varptr(prc), alpha) ; hBufferedPaint : INT_PTR -> "intptr" ; prc : RECT* optional -> "intptr" ; alpha : BYTE -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
uxtheme = windows.NewLazySystemDLL("UxTheme.dll")
procBufferedPaintSetAlpha = uxtheme.NewProc("BufferedPaintSetAlpha")
)
// hBufferedPaint (INT_PTR), prc (RECT* optional), alpha (BYTE)
r1, _, err := procBufferedPaintSetAlpha.Call(
uintptr(hBufferedPaint),
uintptr(prc),
uintptr(alpha),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction BufferedPaintSetAlpha(
hBufferedPaint: NativeInt; // INT_PTR
prc: Pointer; // RECT* optional
alpha: Byte // BYTE
): Integer; stdcall;
external 'UxTheme.dll' name 'BufferedPaintSetAlpha';result := DllCall("UxTheme\BufferedPaintSetAlpha"
, "Ptr", hBufferedPaint ; INT_PTR
, "Ptr", prc ; RECT* optional
, "UChar", alpha ; BYTE
, "Int") ; return: HRESULT●BufferedPaintSetAlpha(hBufferedPaint, prc, alpha) = DLL("UxTheme.dll", "int BufferedPaintSetAlpha(int, void*, byte)")
# 呼び出し: BufferedPaintSetAlpha(hBufferedPaint, prc, alpha)
# hBufferedPaint : INT_PTR -> "int"
# prc : RECT* optional -> "void*"
# alpha : BYTE -> "byte"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。