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

DwmFlush

関数
DWMによる保留中の描画処理が完了するまで待機する。
DLLdwmapi.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT DwmFlush(void);

パラメーターなし。戻り値: HRESULT

各言語での呼び出し定義

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

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

DwmFlush = ctypes.windll.dwmapi.DwmFlush
DwmFlush.restype = ctypes.c_int
DwmFlush.argtypes = []
require 'fiddle'
require 'fiddle/import'

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

var (
	dwmapi = windows.NewLazySystemDLL("dwmapi.dll")
	procDwmFlush = dwmapi.NewProc("DwmFlush")
)

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