Win32 API 日本語リファレンス
ホームSystem.EventCollector › EcRemoveObjectArrayElement

EcRemoveObjectArrayElement

関数
オブジェクト配列から指定要素を削除する。
DLLWecApi.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

BOOL EcRemoveObjectArrayElement(
    INT_PTR ObjectArray,
    DWORD ArrayIndex
);

パラメーター

名前方向
ObjectArrayINT_PTRin
ArrayIndexDWORDin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL EcRemoveObjectArrayElement(
    INT_PTR ObjectArray,
    DWORD ArrayIndex
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WecApi.dll", ExactSpelling = true)]
static extern bool EcRemoveObjectArrayElement(
    IntPtr ObjectArray,   // INT_PTR
    uint ArrayIndex   // DWORD
);
<DllImport("WecApi.dll", ExactSpelling:=True)>
Public Shared Function EcRemoveObjectArrayElement(
    ObjectArray As IntPtr,   ' INT_PTR
    ArrayIndex As UInteger   ' DWORD
) As Boolean
End Function
' ObjectArray : INT_PTR
' ArrayIndex : DWORD
Declare PtrSafe Function EcRemoveObjectArrayElement Lib "wecapi" ( _
    ByVal ObjectArray As LongPtr, _
    ByVal ArrayIndex As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

EcRemoveObjectArrayElement = ctypes.windll.wecapi.EcRemoveObjectArrayElement
EcRemoveObjectArrayElement.restype = wintypes.BOOL
EcRemoveObjectArrayElement.argtypes = [
    ctypes.c_ssize_t,  # ObjectArray : INT_PTR
    wintypes.DWORD,  # ArrayIndex : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WecApi.dll')
EcRemoveObjectArrayElement = Fiddle::Function.new(
  lib['EcRemoveObjectArrayElement'],
  [
    Fiddle::TYPE_INTPTR_T,  # ObjectArray : INT_PTR
    -Fiddle::TYPE_INT,  # ArrayIndex : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "wecapi")]
extern "system" {
    fn EcRemoveObjectArrayElement(
        ObjectArray: isize,  // INT_PTR
        ArrayIndex: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WecApi.dll")]
public static extern bool EcRemoveObjectArrayElement(IntPtr ObjectArray, uint ArrayIndex);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WecApi_EcRemoveObjectArrayElement' -Namespace Win32 -PassThru
# $api::EcRemoveObjectArrayElement(ObjectArray, ArrayIndex)
#uselib "WecApi.dll"
#func global EcRemoveObjectArrayElement "EcRemoveObjectArrayElement" sptr, sptr
; EcRemoveObjectArrayElement ObjectArray, ArrayIndex   ; 戻り値は stat
; ObjectArray : INT_PTR -> "sptr"
; ArrayIndex : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WecApi.dll"
#cfunc global EcRemoveObjectArrayElement "EcRemoveObjectArrayElement" sptr, int
; res = EcRemoveObjectArrayElement(ObjectArray, ArrayIndex)
; ObjectArray : INT_PTR -> "sptr"
; ArrayIndex : DWORD -> "int"
; BOOL EcRemoveObjectArrayElement(INT_PTR ObjectArray, DWORD ArrayIndex)
#uselib "WecApi.dll"
#cfunc global EcRemoveObjectArrayElement "EcRemoveObjectArrayElement" intptr, int
; res = EcRemoveObjectArrayElement(ObjectArray, ArrayIndex)
; ObjectArray : INT_PTR -> "intptr"
; ArrayIndex : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wecapi = windows.NewLazySystemDLL("WecApi.dll")
	procEcRemoveObjectArrayElement = wecapi.NewProc("EcRemoveObjectArrayElement")
)

// ObjectArray (INT_PTR), ArrayIndex (DWORD)
r1, _, err := procEcRemoveObjectArrayElement.Call(
	uintptr(ObjectArray),
	uintptr(ArrayIndex),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function EcRemoveObjectArrayElement(
  ObjectArray: NativeInt;   // INT_PTR
  ArrayIndex: DWORD   // DWORD
): BOOL; stdcall;
  external 'WecApi.dll' name 'EcRemoveObjectArrayElement';
result := DllCall("WecApi\EcRemoveObjectArrayElement"
    , "Ptr", ObjectArray   ; INT_PTR
    , "UInt", ArrayIndex   ; DWORD
    , "Int")   ; return: BOOL
●EcRemoveObjectArrayElement(ObjectArray, ArrayIndex) = DLL("WecApi.dll", "bool EcRemoveObjectArrayElement(int, dword)")
# 呼び出し: EcRemoveObjectArrayElement(ObjectArray, ArrayIndex)
# ObjectArray : INT_PTR -> "int"
# ArrayIndex : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。