ILRemoveLastID
関数アイテムIDリストの末尾IDを削除する。
シグネチャ
// SHELL32.dll
#include <windows.h>
BOOL ILRemoveLastID(
ITEMIDLIST* pidl // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pidl | ITEMIDLIST* | inoutoptional |
戻り値の型: BOOL
各言語での呼び出し定義
// SHELL32.dll
#include <windows.h>
BOOL ILRemoveLastID(
ITEMIDLIST* pidl // optional
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern bool ILRemoveLastID(
IntPtr pidl // ITEMIDLIST* optional, in/out
);<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Function ILRemoveLastID(
pidl As IntPtr ' ITEMIDLIST* optional, in/out
) As Boolean
End Function' pidl : ITEMIDLIST* optional, in/out
Declare PtrSafe Function ILRemoveLastID Lib "shell32" ( _
ByVal pidl As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ILRemoveLastID = ctypes.windll.shell32.ILRemoveLastID
ILRemoveLastID.restype = wintypes.BOOL
ILRemoveLastID.argtypes = [
ctypes.c_void_p, # pidl : ITEMIDLIST* optional, in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHELL32.dll')
ILRemoveLastID = Fiddle::Function.new(
lib['ILRemoveLastID'],
[
Fiddle::TYPE_VOIDP, # pidl : ITEMIDLIST* optional, in/out
],
Fiddle::TYPE_INT)#[link(name = "shell32")]
extern "system" {
fn ILRemoveLastID(
pidl: *mut ITEMIDLIST // ITEMIDLIST* optional, in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHELL32.dll")]
public static extern bool ILRemoveLastID(IntPtr pidl);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_ILRemoveLastID' -Namespace Win32 -PassThru
# $api::ILRemoveLastID(pidl)#uselib "SHELL32.dll"
#func global ILRemoveLastID "ILRemoveLastID" sptr
; ILRemoveLastID varptr(pidl) ; 戻り値は stat
; pidl : ITEMIDLIST* optional, in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "SHELL32.dll" #cfunc global ILRemoveLastID "ILRemoveLastID" var ; res = ILRemoveLastID(pidl) ; pidl : ITEMIDLIST* optional, in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SHELL32.dll" #cfunc global ILRemoveLastID "ILRemoveLastID" sptr ; res = ILRemoveLastID(varptr(pidl)) ; pidl : ITEMIDLIST* optional, in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL ILRemoveLastID(ITEMIDLIST* pidl) #uselib "SHELL32.dll" #cfunc global ILRemoveLastID "ILRemoveLastID" var ; res = ILRemoveLastID(pidl) ; pidl : ITEMIDLIST* optional, in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL ILRemoveLastID(ITEMIDLIST* pidl) #uselib "SHELL32.dll" #cfunc global ILRemoveLastID "ILRemoveLastID" intptr ; res = ILRemoveLastID(varptr(pidl)) ; pidl : ITEMIDLIST* optional, in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shell32 = windows.NewLazySystemDLL("SHELL32.dll")
procILRemoveLastID = shell32.NewProc("ILRemoveLastID")
)
// pidl (ITEMIDLIST* optional, in/out)
r1, _, err := procILRemoveLastID.Call(
uintptr(pidl),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction ILRemoveLastID(
pidl: Pointer // ITEMIDLIST* optional, in/out
): BOOL; stdcall;
external 'SHELL32.dll' name 'ILRemoveLastID';result := DllCall("SHELL32\ILRemoveLastID"
, "Ptr", pidl ; ITEMIDLIST* optional, in/out
, "Int") ; return: BOOL●ILRemoveLastID(pidl) = DLL("SHELL32.dll", "bool ILRemoveLastID(void*)")
# 呼び出し: ILRemoveLastID(pidl)
# pidl : ITEMIDLIST* optional, in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。