ホーム › UI.Controls › SetWindowFeedbackSetting
SetWindowFeedbackSetting
関数ウィンドウのタッチ視覚フィードバック設定を構成する。
シグネチャ
// USER32.dll
#include <windows.h>
BOOL SetWindowFeedbackSetting(
HWND hwnd,
FEEDBACK_TYPE feedback,
DWORD dwFlags,
DWORD size,
const void* configuration // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hwnd | HWND | in |
| feedback | FEEDBACK_TYPE | in |
| dwFlags | DWORD | in |
| size | DWORD | in |
| configuration | void* | inoptional |
戻り値の型: BOOL
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
BOOL SetWindowFeedbackSetting(
HWND hwnd,
FEEDBACK_TYPE feedback,
DWORD dwFlags,
DWORD size,
const void* configuration // optional
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", ExactSpelling = true)]
static extern bool SetWindowFeedbackSetting(
IntPtr hwnd, // HWND
int feedback, // FEEDBACK_TYPE
uint dwFlags, // DWORD
uint size, // DWORD
IntPtr configuration // void* optional
);<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function SetWindowFeedbackSetting(
hwnd As IntPtr, ' HWND
feedback As Integer, ' FEEDBACK_TYPE
dwFlags As UInteger, ' DWORD
size As UInteger, ' DWORD
configuration As IntPtr ' void* optional
) As Boolean
End Function' hwnd : HWND
' feedback : FEEDBACK_TYPE
' dwFlags : DWORD
' size : DWORD
' configuration : void* optional
Declare PtrSafe Function SetWindowFeedbackSetting Lib "user32" ( _
ByVal hwnd As LongPtr, _
ByVal feedback As Long, _
ByVal dwFlags As Long, _
ByVal size As Long, _
ByVal configuration As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SetWindowFeedbackSetting = ctypes.windll.user32.SetWindowFeedbackSetting
SetWindowFeedbackSetting.restype = wintypes.BOOL
SetWindowFeedbackSetting.argtypes = [
wintypes.HANDLE, # hwnd : HWND
ctypes.c_int, # feedback : FEEDBACK_TYPE
wintypes.DWORD, # dwFlags : DWORD
wintypes.DWORD, # size : DWORD
ctypes.POINTER(None), # configuration : void* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
SetWindowFeedbackSetting = Fiddle::Function.new(
lib['SetWindowFeedbackSetting'],
[
Fiddle::TYPE_VOIDP, # hwnd : HWND
Fiddle::TYPE_INT, # feedback : FEEDBACK_TYPE
-Fiddle::TYPE_INT, # dwFlags : DWORD
-Fiddle::TYPE_INT, # size : DWORD
Fiddle::TYPE_VOIDP, # configuration : void* optional
],
Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn SetWindowFeedbackSetting(
hwnd: *mut core::ffi::c_void, // HWND
feedback: i32, // FEEDBACK_TYPE
dwFlags: u32, // DWORD
size: u32, // DWORD
configuration: *const () // void* optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll")]
public static extern bool SetWindowFeedbackSetting(IntPtr hwnd, int feedback, uint dwFlags, uint size, IntPtr configuration);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_SetWindowFeedbackSetting' -Namespace Win32 -PassThru
# $api::SetWindowFeedbackSetting(hwnd, feedback, dwFlags, size, configuration)#uselib "USER32.dll"
#func global SetWindowFeedbackSetting "SetWindowFeedbackSetting" sptr, sptr, sptr, sptr, sptr
; SetWindowFeedbackSetting hwnd, feedback, dwFlags, size, configuration ; 戻り値は stat
; hwnd : HWND -> "sptr"
; feedback : FEEDBACK_TYPE -> "sptr"
; dwFlags : DWORD -> "sptr"
; size : DWORD -> "sptr"
; configuration : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "USER32.dll"
#cfunc global SetWindowFeedbackSetting "SetWindowFeedbackSetting" sptr, int, int, int, sptr
; res = SetWindowFeedbackSetting(hwnd, feedback, dwFlags, size, configuration)
; hwnd : HWND -> "sptr"
; feedback : FEEDBACK_TYPE -> "int"
; dwFlags : DWORD -> "int"
; size : DWORD -> "int"
; configuration : void* optional -> "sptr"; BOOL SetWindowFeedbackSetting(HWND hwnd, FEEDBACK_TYPE feedback, DWORD dwFlags, DWORD size, void* configuration)
#uselib "USER32.dll"
#cfunc global SetWindowFeedbackSetting "SetWindowFeedbackSetting" intptr, int, int, int, intptr
; res = SetWindowFeedbackSetting(hwnd, feedback, dwFlags, size, configuration)
; hwnd : HWND -> "intptr"
; feedback : FEEDBACK_TYPE -> "int"
; dwFlags : DWORD -> "int"
; size : DWORD -> "int"
; configuration : void* optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procSetWindowFeedbackSetting = user32.NewProc("SetWindowFeedbackSetting")
)
// hwnd (HWND), feedback (FEEDBACK_TYPE), dwFlags (DWORD), size (DWORD), configuration (void* optional)
r1, _, err := procSetWindowFeedbackSetting.Call(
uintptr(hwnd),
uintptr(feedback),
uintptr(dwFlags),
uintptr(size),
uintptr(configuration),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction SetWindowFeedbackSetting(
hwnd: THandle; // HWND
feedback: Integer; // FEEDBACK_TYPE
dwFlags: DWORD; // DWORD
size: DWORD; // DWORD
configuration: Pointer // void* optional
): BOOL; stdcall;
external 'USER32.dll' name 'SetWindowFeedbackSetting';result := DllCall("USER32\SetWindowFeedbackSetting"
, "Ptr", hwnd ; HWND
, "Int", feedback ; FEEDBACK_TYPE
, "UInt", dwFlags ; DWORD
, "UInt", size ; DWORD
, "Ptr", configuration ; void* optional
, "Int") ; return: BOOL●SetWindowFeedbackSetting(hwnd, feedback, dwFlags, size, configuration) = DLL("USER32.dll", "bool SetWindowFeedbackSetting(void*, int, dword, dword, void*)")
# 呼び出し: SetWindowFeedbackSetting(hwnd, feedback, dwFlags, size, configuration)
# hwnd : HWND -> "void*"
# feedback : FEEDBACK_TYPE -> "int"
# dwFlags : DWORD -> "dword"
# size : DWORD -> "dword"
# configuration : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。