Win32 API 日本語リファレンス
ホームUI.WindowsAndMessaging › RegisterForTooltipDismissNotification

RegisterForTooltipDismissNotification

関数
ツールチップ消去通知の受信を登録する。
DLLUSER32.dll呼出規約winapi

シグネチャ

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

BOOL RegisterForTooltipDismissNotification(
    HWND hWnd,
    TOOLTIP_DISMISS_FLAGS tdFlags
);

パラメーター

名前方向
hWndHWNDin
tdFlagsTOOLTIP_DISMISS_FLAGSin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL RegisterForTooltipDismissNotification(
    HWND hWnd,
    TOOLTIP_DISMISS_FLAGS tdFlags
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", ExactSpelling = true)]
static extern bool RegisterForTooltipDismissNotification(
    IntPtr hWnd,   // HWND
    int tdFlags   // TOOLTIP_DISMISS_FLAGS
);
<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function RegisterForTooltipDismissNotification(
    hWnd As IntPtr,   ' HWND
    tdFlags As Integer   ' TOOLTIP_DISMISS_FLAGS
) As Boolean
End Function
' hWnd : HWND
' tdFlags : TOOLTIP_DISMISS_FLAGS
Declare PtrSafe Function RegisterForTooltipDismissNotification Lib "user32" ( _
    ByVal hWnd As LongPtr, _
    ByVal tdFlags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RegisterForTooltipDismissNotification = ctypes.windll.user32.RegisterForTooltipDismissNotification
RegisterForTooltipDismissNotification.restype = wintypes.BOOL
RegisterForTooltipDismissNotification.argtypes = [
    wintypes.HANDLE,  # hWnd : HWND
    ctypes.c_int,  # tdFlags : TOOLTIP_DISMISS_FLAGS
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('USER32.dll')
RegisterForTooltipDismissNotification = Fiddle::Function.new(
  lib['RegisterForTooltipDismissNotification'],
  [
    Fiddle::TYPE_VOIDP,  # hWnd : HWND
    Fiddle::TYPE_INT,  # tdFlags : TOOLTIP_DISMISS_FLAGS
  ],
  Fiddle::TYPE_INT)
#[link(name = "user32")]
extern "system" {
    fn RegisterForTooltipDismissNotification(
        hWnd: *mut core::ffi::c_void,  // HWND
        tdFlags: i32  // TOOLTIP_DISMISS_FLAGS
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll")]
public static extern bool RegisterForTooltipDismissNotification(IntPtr hWnd, int tdFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_RegisterForTooltipDismissNotification' -Namespace Win32 -PassThru
# $api::RegisterForTooltipDismissNotification(hWnd, tdFlags)
#uselib "USER32.dll"
#func global RegisterForTooltipDismissNotification "RegisterForTooltipDismissNotification" sptr, sptr
; RegisterForTooltipDismissNotification hWnd, tdFlags   ; 戻り値は stat
; hWnd : HWND -> "sptr"
; tdFlags : TOOLTIP_DISMISS_FLAGS -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "USER32.dll"
#cfunc global RegisterForTooltipDismissNotification "RegisterForTooltipDismissNotification" sptr, int
; res = RegisterForTooltipDismissNotification(hWnd, tdFlags)
; hWnd : HWND -> "sptr"
; tdFlags : TOOLTIP_DISMISS_FLAGS -> "int"
; BOOL RegisterForTooltipDismissNotification(HWND hWnd, TOOLTIP_DISMISS_FLAGS tdFlags)
#uselib "USER32.dll"
#cfunc global RegisterForTooltipDismissNotification "RegisterForTooltipDismissNotification" intptr, int
; res = RegisterForTooltipDismissNotification(hWnd, tdFlags)
; hWnd : HWND -> "intptr"
; tdFlags : TOOLTIP_DISMISS_FLAGS -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procRegisterForTooltipDismissNotification = user32.NewProc("RegisterForTooltipDismissNotification")
)

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