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

ILFree

関数
アイテムIDリストのメモリを解放する。
DLLSHELL32.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

void ILFree(
    ITEMIDLIST* pidl   // optional
);

パラメーター

名前方向
pidlITEMIDLIST*inoptional

戻り値の型: void

各言語での呼び出し定義

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

void ILFree(
    ITEMIDLIST* pidl   // optional
);
[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern void ILFree(
    IntPtr pidl   // ITEMIDLIST* optional
);
<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Sub ILFree(
    pidl As IntPtr   ' ITEMIDLIST* optional
)
End Sub
' pidl : ITEMIDLIST* optional
Declare PtrSafe Sub ILFree Lib "shell32" ( _
    ByVal pidl As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ILFree = ctypes.windll.shell32.ILFree
ILFree.restype = None
ILFree.argtypes = [
    ctypes.c_void_p,  # pidl : ITEMIDLIST* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SHELL32.dll')
ILFree = Fiddle::Function.new(
  lib['ILFree'],
  [
    Fiddle::TYPE_VOIDP,  # pidl : ITEMIDLIST* optional
  ],
  Fiddle::TYPE_VOID)
#[link(name = "shell32")]
extern "system" {
    fn ILFree(
        pidl: *mut ITEMIDLIST  // ITEMIDLIST* optional
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SHELL32.dll")]
public static extern void ILFree(IntPtr pidl);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_ILFree' -Namespace Win32 -PassThru
# $api::ILFree(pidl)
#uselib "SHELL32.dll"
#func global ILFree "ILFree" sptr
; ILFree varptr(pidl)
; pidl : ITEMIDLIST* optional -> "sptr"
出力引数:
#uselib "SHELL32.dll"
#func global ILFree "ILFree" var
; ILFree pidl
; pidl : ITEMIDLIST* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void ILFree(ITEMIDLIST* pidl)
#uselib "SHELL32.dll"
#func global ILFree "ILFree" var
; ILFree pidl
; pidl : ITEMIDLIST* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	shell32 = windows.NewLazySystemDLL("SHELL32.dll")
	procILFree = shell32.NewProc("ILFree")
)

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