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

DPA_DeletePtr

関数
動的ポインタ配列から指定ポインタを削除する。
DLLCOMCTL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

void* DPA_DeletePtr(
    HDPA hdpa,
    INT i
);

パラメーター

名前方向
hdpaHDPAin
iINTin

戻り値の型: void*

各言語での呼び出し定義

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

void* DPA_DeletePtr(
    HDPA hdpa,
    INT i
);
[DllImport("COMCTL32.dll", ExactSpelling = true)]
static extern IntPtr DPA_DeletePtr(
    IntPtr hdpa,   // HDPA
    int i   // INT
);
<DllImport("COMCTL32.dll", ExactSpelling:=True)>
Public Shared Function DPA_DeletePtr(
    hdpa As IntPtr,   ' HDPA
    i As Integer   ' INT
) As IntPtr
End Function
' hdpa : HDPA
' i : INT
Declare PtrSafe Function DPA_DeletePtr Lib "comctl32" ( _
    ByVal hdpa As LongPtr, _
    ByVal i As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DPA_DeletePtr = ctypes.windll.comctl32.DPA_DeletePtr
DPA_DeletePtr.restype = ctypes.c_void_p
DPA_DeletePtr.argtypes = [
    ctypes.c_ssize_t,  # hdpa : HDPA
    ctypes.c_int,  # i : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
	procDPA_DeletePtr = comctl32.NewProc("DPA_DeletePtr")
)

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