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

DwmIsCompositionEnabled

関数
DWMの合成が有効かどうかを取得する。
DLLdwmapi.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT DwmIsCompositionEnabled(
    BOOL* pfEnabled
);

パラメーター

名前方向
pfEnabledBOOL*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DwmIsCompositionEnabled(
    BOOL* pfEnabled
);
[DllImport("dwmapi.dll", ExactSpelling = true)]
static extern int DwmIsCompositionEnabled(
    out int pfEnabled   // BOOL* out
);
<DllImport("dwmapi.dll", ExactSpelling:=True)>
Public Shared Function DwmIsCompositionEnabled(
    <Out> ByRef pfEnabled As Integer   ' BOOL* out
) As Integer
End Function
' pfEnabled : BOOL* out
Declare PtrSafe Function DwmIsCompositionEnabled Lib "dwmapi" ( _
    ByRef pfEnabled As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DwmIsCompositionEnabled = ctypes.windll.dwmapi.DwmIsCompositionEnabled
DwmIsCompositionEnabled.restype = ctypes.c_int
DwmIsCompositionEnabled.argtypes = [
    ctypes.c_void_p,  # pfEnabled : BOOL* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dwmapi = windows.NewLazySystemDLL("dwmapi.dll")
	procDwmIsCompositionEnabled = dwmapi.NewProc("DwmIsCompositionEnabled")
)

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