ホーム › Graphics.DirectComposition › DCompositionAttachMouseWheelToHwnd
DCompositionAttachMouseWheelToHwnd
関数ビジュアルへのマウスホイール操作を指定ウィンドウに転送する。
シグネチャ
// dcomp.dll
#include <windows.h>
HRESULT DCompositionAttachMouseWheelToHwnd(
IDCompositionVisual* visual,
HWND hwnd,
BOOL enable
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| visual | IDCompositionVisual* | in |
| hwnd | HWND | in |
| enable | BOOL | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// dcomp.dll
#include <windows.h>
HRESULT DCompositionAttachMouseWheelToHwnd(
IDCompositionVisual* visual,
HWND hwnd,
BOOL enable
);[DllImport("dcomp.dll", ExactSpelling = true)]
static extern int DCompositionAttachMouseWheelToHwnd(
IntPtr visual, // IDCompositionVisual*
IntPtr hwnd, // HWND
bool enable // BOOL
);<DllImport("dcomp.dll", ExactSpelling:=True)>
Public Shared Function DCompositionAttachMouseWheelToHwnd(
visual As IntPtr, ' IDCompositionVisual*
hwnd As IntPtr, ' HWND
enable As Boolean ' BOOL
) As Integer
End Function' visual : IDCompositionVisual*
' hwnd : HWND
' enable : BOOL
Declare PtrSafe Function DCompositionAttachMouseWheelToHwnd Lib "dcomp" ( _
ByVal visual As LongPtr, _
ByVal hwnd As LongPtr, _
ByVal enable As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DCompositionAttachMouseWheelToHwnd = ctypes.windll.dcomp.DCompositionAttachMouseWheelToHwnd
DCompositionAttachMouseWheelToHwnd.restype = ctypes.c_int
DCompositionAttachMouseWheelToHwnd.argtypes = [
ctypes.c_void_p, # visual : IDCompositionVisual*
wintypes.HANDLE, # hwnd : HWND
wintypes.BOOL, # enable : BOOL
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('dcomp.dll')
DCompositionAttachMouseWheelToHwnd = Fiddle::Function.new(
lib['DCompositionAttachMouseWheelToHwnd'],
[
Fiddle::TYPE_VOIDP, # visual : IDCompositionVisual*
Fiddle::TYPE_VOIDP, # hwnd : HWND
Fiddle::TYPE_INT, # enable : BOOL
],
Fiddle::TYPE_INT)#[link(name = "dcomp")]
extern "system" {
fn DCompositionAttachMouseWheelToHwnd(
visual: *mut core::ffi::c_void, // IDCompositionVisual*
hwnd: *mut core::ffi::c_void, // HWND
enable: i32 // BOOL
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("dcomp.dll")]
public static extern int DCompositionAttachMouseWheelToHwnd(IntPtr visual, IntPtr hwnd, bool enable);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dcomp_DCompositionAttachMouseWheelToHwnd' -Namespace Win32 -PassThru
# $api::DCompositionAttachMouseWheelToHwnd(visual, hwnd, enable)#uselib "dcomp.dll"
#func global DCompositionAttachMouseWheelToHwnd "DCompositionAttachMouseWheelToHwnd" sptr, sptr, sptr
; DCompositionAttachMouseWheelToHwnd visual, hwnd, enable ; 戻り値は stat
; visual : IDCompositionVisual* -> "sptr"
; hwnd : HWND -> "sptr"
; enable : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "dcomp.dll"
#cfunc global DCompositionAttachMouseWheelToHwnd "DCompositionAttachMouseWheelToHwnd" sptr, sptr, int
; res = DCompositionAttachMouseWheelToHwnd(visual, hwnd, enable)
; visual : IDCompositionVisual* -> "sptr"
; hwnd : HWND -> "sptr"
; enable : BOOL -> "int"; HRESULT DCompositionAttachMouseWheelToHwnd(IDCompositionVisual* visual, HWND hwnd, BOOL enable)
#uselib "dcomp.dll"
#cfunc global DCompositionAttachMouseWheelToHwnd "DCompositionAttachMouseWheelToHwnd" intptr, intptr, int
; res = DCompositionAttachMouseWheelToHwnd(visual, hwnd, enable)
; visual : IDCompositionVisual* -> "intptr"
; hwnd : HWND -> "intptr"
; enable : BOOL -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
dcomp = windows.NewLazySystemDLL("dcomp.dll")
procDCompositionAttachMouseWheelToHwnd = dcomp.NewProc("DCompositionAttachMouseWheelToHwnd")
)
// visual (IDCompositionVisual*), hwnd (HWND), enable (BOOL)
r1, _, err := procDCompositionAttachMouseWheelToHwnd.Call(
uintptr(visual),
uintptr(hwnd),
uintptr(enable),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction DCompositionAttachMouseWheelToHwnd(
visual: Pointer; // IDCompositionVisual*
hwnd: THandle; // HWND
enable: BOOL // BOOL
): Integer; stdcall;
external 'dcomp.dll' name 'DCompositionAttachMouseWheelToHwnd';result := DllCall("dcomp\DCompositionAttachMouseWheelToHwnd"
, "Ptr", visual ; IDCompositionVisual*
, "Ptr", hwnd ; HWND
, "Int", enable ; BOOL
, "Int") ; return: HRESULT●DCompositionAttachMouseWheelToHwnd(visual, hwnd, enable) = DLL("dcomp.dll", "int DCompositionAttachMouseWheelToHwnd(void*, void*, bool)")
# 呼び出し: DCompositionAttachMouseWheelToHwnd(visual, hwnd, enable)
# visual : IDCompositionVisual* -> "void*"
# hwnd : HWND -> "void*"
# enable : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。