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

ImageList_DragEnter

関数
ドラッグ画像を表示しウィンドウをロックする。
DLLCOMCTL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

BOOL ImageList_DragEnter(
    HWND hwndLock,
    INT x,
    INT y
);

パラメーター

名前方向
hwndLockHWNDin
xINTin
yINTin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

ImageList_DragEnter = ctypes.windll.comctl32.ImageList_DragEnter
ImageList_DragEnter.restype = wintypes.BOOL
ImageList_DragEnter.argtypes = [
    wintypes.HANDLE,  # hwndLock : HWND
    ctypes.c_int,  # x : INT
    ctypes.c_int,  # y : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
	procImageList_DragEnter = comctl32.NewProc("ImageList_DragEnter")
)

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