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

DwmGetGraphicsStreamClient

関数
指定インデックスのグラフィックスストリームクライアントUUIDを取得する。
DLLdwmapi.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT DwmGetGraphicsStreamClient(
    DWORD uIndex,
    GUID* pClientUuid
);

パラメーター

名前方向
uIndexDWORDin
pClientUuidGUID*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

DwmGetGraphicsStreamClient = ctypes.windll.dwmapi.DwmGetGraphicsStreamClient
DwmGetGraphicsStreamClient.restype = ctypes.c_int
DwmGetGraphicsStreamClient.argtypes = [
    wintypes.DWORD,  # uIndex : DWORD
    ctypes.c_void_p,  # pClientUuid : GUID* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dwmapi = windows.NewLazySystemDLL("dwmapi.dll")
	procDwmGetGraphicsStreamClient = dwmapi.NewProc("DwmGetGraphicsStreamClient")
)

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