ホーム › UI.Controls › ImageList_BeginDrag
ImageList_BeginDrag
関数イメージリスト画像を用いたドラッグ操作を開始する。
シグネチャ
// COMCTL32.dll
#include <windows.h>
BOOL ImageList_BeginDrag(
HIMAGELIST himlTrack,
INT iTrack,
INT dxHotspot,
INT dyHotspot
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| himlTrack | HIMAGELIST | in |
| iTrack | INT | in |
| dxHotspot | INT | in |
| dyHotspot | INT | in |
戻り値の型: BOOL
各言語での呼び出し定義
// COMCTL32.dll
#include <windows.h>
BOOL ImageList_BeginDrag(
HIMAGELIST himlTrack,
INT iTrack,
INT dxHotspot,
INT dyHotspot
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("COMCTL32.dll", ExactSpelling = true)]
static extern bool ImageList_BeginDrag(
IntPtr himlTrack, // HIMAGELIST
int iTrack, // INT
int dxHotspot, // INT
int dyHotspot // INT
);<DllImport("COMCTL32.dll", ExactSpelling:=True)>
Public Shared Function ImageList_BeginDrag(
himlTrack As IntPtr, ' HIMAGELIST
iTrack As Integer, ' INT
dxHotspot As Integer, ' INT
dyHotspot As Integer ' INT
) As Boolean
End Function' himlTrack : HIMAGELIST
' iTrack : INT
' dxHotspot : INT
' dyHotspot : INT
Declare PtrSafe Function ImageList_BeginDrag Lib "comctl32" ( _
ByVal himlTrack As LongPtr, _
ByVal iTrack As Long, _
ByVal dxHotspot As Long, _
ByVal dyHotspot As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ImageList_BeginDrag = ctypes.windll.comctl32.ImageList_BeginDrag
ImageList_BeginDrag.restype = wintypes.BOOL
ImageList_BeginDrag.argtypes = [
ctypes.c_ssize_t, # himlTrack : HIMAGELIST
ctypes.c_int, # iTrack : INT
ctypes.c_int, # dxHotspot : INT
ctypes.c_int, # dyHotspot : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('COMCTL32.dll')
ImageList_BeginDrag = Fiddle::Function.new(
lib['ImageList_BeginDrag'],
[
Fiddle::TYPE_INTPTR_T, # himlTrack : HIMAGELIST
Fiddle::TYPE_INT, # iTrack : INT
Fiddle::TYPE_INT, # dxHotspot : INT
Fiddle::TYPE_INT, # dyHotspot : INT
],
Fiddle::TYPE_INT)#[link(name = "comctl32")]
extern "system" {
fn ImageList_BeginDrag(
himlTrack: isize, // HIMAGELIST
iTrack: i32, // INT
dxHotspot: i32, // INT
dyHotspot: 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_BeginDrag(IntPtr himlTrack, int iTrack, int dxHotspot, int dyHotspot);
"@
$api = Add-Type -MemberDefinition $sig -Name 'COMCTL32_ImageList_BeginDrag' -Namespace Win32 -PassThru
# $api::ImageList_BeginDrag(himlTrack, iTrack, dxHotspot, dyHotspot)#uselib "COMCTL32.dll"
#func global ImageList_BeginDrag "ImageList_BeginDrag" sptr, sptr, sptr, sptr
; ImageList_BeginDrag himlTrack, iTrack, dxHotspot, dyHotspot ; 戻り値は stat
; himlTrack : HIMAGELIST -> "sptr"
; iTrack : INT -> "sptr"
; dxHotspot : INT -> "sptr"
; dyHotspot : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "COMCTL32.dll"
#cfunc global ImageList_BeginDrag "ImageList_BeginDrag" sptr, int, int, int
; res = ImageList_BeginDrag(himlTrack, iTrack, dxHotspot, dyHotspot)
; himlTrack : HIMAGELIST -> "sptr"
; iTrack : INT -> "int"
; dxHotspot : INT -> "int"
; dyHotspot : INT -> "int"; BOOL ImageList_BeginDrag(HIMAGELIST himlTrack, INT iTrack, INT dxHotspot, INT dyHotspot)
#uselib "COMCTL32.dll"
#cfunc global ImageList_BeginDrag "ImageList_BeginDrag" intptr, int, int, int
; res = ImageList_BeginDrag(himlTrack, iTrack, dxHotspot, dyHotspot)
; himlTrack : HIMAGELIST -> "intptr"
; iTrack : INT -> "int"
; dxHotspot : INT -> "int"
; dyHotspot : INT -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
procImageList_BeginDrag = comctl32.NewProc("ImageList_BeginDrag")
)
// himlTrack (HIMAGELIST), iTrack (INT), dxHotspot (INT), dyHotspot (INT)
r1, _, err := procImageList_BeginDrag.Call(
uintptr(himlTrack),
uintptr(iTrack),
uintptr(dxHotspot),
uintptr(dyHotspot),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction ImageList_BeginDrag(
himlTrack: NativeInt; // HIMAGELIST
iTrack: Integer; // INT
dxHotspot: Integer; // INT
dyHotspot: Integer // INT
): BOOL; stdcall;
external 'COMCTL32.dll' name 'ImageList_BeginDrag';result := DllCall("COMCTL32\ImageList_BeginDrag"
, "Ptr", himlTrack ; HIMAGELIST
, "Int", iTrack ; INT
, "Int", dxHotspot ; INT
, "Int", dyHotspot ; INT
, "Int") ; return: BOOL●ImageList_BeginDrag(himlTrack, iTrack, dxHotspot, dyHotspot) = DLL("COMCTL32.dll", "bool ImageList_BeginDrag(int, int, int, int)")
# 呼び出し: ImageList_BeginDrag(himlTrack, iTrack, dxHotspot, dyHotspot)
# himlTrack : HIMAGELIST -> "int"
# iTrack : INT -> "int"
# dxHotspot : INT -> "int"
# dyHotspot : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。